[PATCH 3/6] ASoC: samsung: smdk_wm8994: add missing return

Krzysztof Kozlowski krzk at kernel.org
Sun Feb 21 11:59:05 CET 2021


On Fri, Feb 19, 2021 at 05:09:15PM -0600, Pierre-Louis Bossart wrote:
> cppcheck warning:
> 
> sound/soc/samsung/smdk_wm8994.c:179:6: style: Variable 'ret' is
> reassigned a value before the old one has been
> used. [redundantAssignment]
>  ret = devm_snd_soc_register_card(&pdev->dev, card);
>      ^
> sound/soc/samsung/smdk_wm8994.c:166:8: note: ret is assigned
>    ret = -EINVAL;
>        ^
> sound/soc/samsung/smdk_wm8994.c:179:6: note: ret is overwritten
>  ret = devm_snd_soc_register_card(&pdev->dev, card);
>      ^
> 
> The initial authors bothered to set ret to -EINVAL and throw a
> dev_err() message, so it looks like there is a missing return to avoid
> continuing if the property is missing.

Good catch. It's a required property.

Reviewed-by: Krzysztof Kozlowski <krzk at kernel.org>

Best regards,
Krzysztof


More information about the Alsa-devel mailing list