ASoC: amd: Fix an ignored error return from platform_get_irq_byname()
Subsystems (3)
PATCH v2 1/1 ASoC: amd: Fix an ignored error return from platform_get_irq_byname()
The return from the call to platform_get_irq_byname() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'adata->i2s_irq', so assign the value to 'ret' concurrently to solve this problem without affecting other functions.
Eliminate the following coccicheck warning:
./sound/soc/amd/acp/acp-renoir.c:286:5-19: WARNING: Unsigned expression compared with zero: adata -> i2s_irq < 0
---
--Changes in v2:
Report the error code is being returned rather than squashing it down to -ENODEV.
sound/soc/amd/acp/acp-renoir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/amd/acp/acp-renoir.c +3 -3
@@ -282,9 +282,9 @@ static int renoir_audio_probe(struct platform_device *pdev)if (!adata->acp_base)return -ENOMEM ; - adata->i2s_irq =platform_get_irq_byname (pdev,"acp_dai_irq" ); -if (adata->i2s_irq <0 ) -return -ENODEV ; + adata->i2s_irq = ret =platform_get_irq_byname (pdev,"acp_dai_irq" ); +if (ret <0 ) +return ret; adata->dev = dev; adata->dai_driver = acp_renoir_dai;
Signature · 1 line
2.20.1.7.g153144c
Mark Brown
maintainerQuoted 4 lines · Yang Li
The return from the call to
platform_get_irq_byname()is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'adata->i2s_irq', so assign the value to 'ret' concurrently to solve this problem without affecting other functions.
This doesn't apply against current code, please check and resend.
Mark Brown
maintainerQuoted 4 lines · Yang Li
The return from the call to
platform_get_irq_byname()is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'adata->i2s_irq', so assign the value to 'ret' concurrently to solve this problem without affecting other functions.
This doesn't apply against current code, please check and resend.