public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	ldv-project@linuxtesting.org
Subject: Re: [PATCH] ASoC: max98090: Remove unneeded check in max98090_put_enab_tlv()
Date: Thu, 19 May 2022 18:29:26 +0100	[thread overview]
Message-ID: <YoZ+dmprwb5Ohto3@sirena.org.uk> (raw)
In-Reply-To: <1652980212-21473-1-git-send-email-khoroshilov@ispras.ru>

[-- Attachment #1: Type: text/plain, Size: 418 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-05-19 17:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19 17:10 [PATCH] ASoC: max98090: Remove unneeded check in max98090_put_enab_tlv() Alexey Khoroshilov
2022-05-19 17:29 ` Mark Brown [this message]
2022-05-19 17:49   ` Pierre-Louis Bossart
2022-05-19 17:49   ` Alexey Khoroshilov
2022-05-19 17:54     ` Mark Brown
2022-05-19 18:27       ` Alexey Khoroshilov
2022-05-19 20:07         ` Mark Brown
2022-05-19 20:13           ` Alexey Khoroshilov
2022-05-19 20:31             ` Mark Brown
2022-05-19 22:31           ` [PATCH] ASoC: max98090: Move check for invalid values before casting " Alexey Khoroshilov
2022-05-20 16:58             ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YoZ+dmprwb5Ohto3@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=khoroshilov@ispras.ru \
    --cc=ldv-project@linuxtesting.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox