summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNikita Zhandarovich <n.zhandarovich@fintech.ru>2025-01-16 06:24:36 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-27 04:30:22 -0800
commitda2ce0dfa2f9c773dd1a34c50073d3e4ead8e2e8 (patch)
tree83b4765e9be89dc3bfbf3d27698bea55dc739a64 /sound
parent62ab1ae5511c59b5f0bf550136ff321331adca9f (diff)
downloadlinux-da2ce0dfa2f9c773dd1a34c50073d3e4ead8e2e8.tar.gz
linux-da2ce0dfa2f9c773dd1a34c50073d3e4ead8e2e8.tar.bz2
linux-da2ce0dfa2f9c773dd1a34c50073d3e4ead8e2e8.zip
ASoC: fsl_micfil: Enable default case in micfil_set_quality()
commit a8c9a453387640dbe45761970f41301a6985e7fa upstream. If 'micfil->quality' received from micfil_quality_set() somehow ends up with an unpredictable value, switch() operator will fail to initialize local variable qsel before regmap_update_bits() tries to utilize it. While it is unlikely, play it safe and enable a default case that returns -EINVAL error. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: bea1d61d5892 ("ASoC: fsl_micfil: rework quality setting") Cc: stable@vger.kernel.org Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru> Link: https://patch.msgid.link/20250116142436.22389-1-n.zhandarovich@fintech.ru Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_micfil.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c
index 67c2d4cb0dea..7cfe77b57b3c 100644
--- a/sound/soc/fsl/fsl_micfil.c
+++ b/sound/soc/fsl/fsl_micfil.c
@@ -156,6 +156,8 @@ static int micfil_set_quality(struct fsl_micfil *micfil)
case QUALITY_VLOW2:
qsel = MICFIL_QSEL_VLOW2_QUALITY;
break;
+ default:
+ return -EINVAL;
}
return regmap_update_bits(micfil->regmap, REG_MICFIL_CTRL2,