[PATCH] ASoC: max98090: Remove unneeded check in max98090_put_enab_tlv()

Mark Brown broonie at kernel.org
Thu May 19 19:29:26 CEST 2022


On Thu, May 19, 2022 at 08:10:12PM +0300, Alexey Khoroshilov wrote:
> Variable sel is of unsigned int type, so sel < 0 is not required.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.

>  	val = (val >> mc->shift) & mask;
>  
> -	if (sel < 0 || sel > mc->max)
> +	if (sel > mc->max)

The check needs to be moved, not removed.  The userspace ABI allows
passing in of negative values.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20220519/915646de/attachment.sig>


More information about the Alsa-devel mailing list