Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: amd: acp: fix for invalid dai id handling in acp_get_byte_count()

For invalid dai id, instead of returning -EINVAL
return bytes count as zero in acp_get_byte_count() function.

Fixes: 623621a9f9e1 ("ASoC: amd: Add common framework to support I2S on ACP SOC")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Vijendar Mukunda and committed by
Mark Brown
85aeab36 68a653ab

+4 -3
+4 -3
sound/soc/amd/acp/amd.h
··· 173 173 174 174 static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int direction) 175 175 { 176 - u64 byte_count, low = 0, high = 0; 176 + u64 byte_count = 0, low = 0, high = 0; 177 177 178 178 if (direction == SNDRV_PCM_STREAM_PLAYBACK) { 179 179 switch (dai_id) { ··· 191 191 break; 192 192 default: 193 193 dev_err(adata->dev, "Invalid dai id %x\n", dai_id); 194 - return -EINVAL; 194 + goto POINTER_RETURN_BYTES; 195 195 } 196 196 } else { 197 197 switch (dai_id) { ··· 213 213 break; 214 214 default: 215 215 dev_err(adata->dev, "Invalid dai id %x\n", dai_id); 216 - return -EINVAL; 216 + goto POINTER_RETURN_BYTES; 217 217 } 218 218 } 219 219 /* Get 64 bit value from two 32 bit registers */ 220 220 byte_count = (high << 32) | low; 221 221 222 + POINTER_RETURN_BYTES: 222 223 return byte_count; 223 224 } 224 225