All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: max98090: Remove unneeded check in max98090_put_enab_tlv()
@ 2022-05-19 17:10 ` Alexey Khoroshilov
  0 siblings, 0 replies; 22+ messages in thread
From: Alexey Khoroshilov @ 2022-05-19 17:10 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: Alexey Khoroshilov, Jaroslav Kysela, Takashi Iwai, alsa-devel,
	linux-kernel, ldv-project

Variable sel is of unsigned int type, so sel < 0 is not required.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 2fbe467bcbfc ("ASoC: max98090: Reject invalid values in custom control put()")
---
 sound/soc/codecs/max98090.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 62b41ca050a2..c535a8496bf1 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -413,7 +413,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
 
 	val = (val >> mc->shift) & mask;
 
-	if (sel < 0 || sel > mc->max)
+	if (sel > mc->max)
 		return -EINVAL;
 
 	*select = sel;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-05-20 17:00 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 17:10 [PATCH] ASoC: max98090: Remove unneeded check in max98090_put_enab_tlv() Alexey Khoroshilov
2022-05-19 17:10 ` Alexey Khoroshilov
2022-05-19 17:29 ` Mark Brown
2022-05-19 17:29   ` Mark Brown
2022-05-19 17:49   ` Pierre-Louis Bossart
2022-05-19 17:49     ` Pierre-Louis Bossart
2022-05-19 17:49   ` Alexey Khoroshilov
2022-05-19 17:49     ` Alexey Khoroshilov
2022-05-19 17:54     ` Mark Brown
2022-05-19 17:54       ` Mark Brown
2022-05-19 18:27       ` Alexey Khoroshilov
2022-05-19 18:27         ` Alexey Khoroshilov
2022-05-19 20:07         ` Mark Brown
2022-05-19 20:07           ` Mark Brown
2022-05-19 20:13           ` Alexey Khoroshilov
2022-05-19 20:13             ` Alexey Khoroshilov
2022-05-19 20:31             ` Mark Brown
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-19 22:31             ` Alexey Khoroshilov
2022-05-20 16:58             ` Mark Brown
2022-05-20 16:58               ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.