]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: fsl_micfil: Enable default case in micfil_set_quality()
authorNikita Zhandarovich <n.zhandarovich@fintech.ru>
Thu, 16 Jan 2025 14:24:36 +0000 (06:24 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Feb 2025 12:34:20 +0000 (04:34 -0800)
commita32b46045455ebc12ef3793bf2b9ff2c7f89defe
treefef34734b39414209626e025377567d23d3fa5e4
parent6c18f5eb2043ebf4674c08a9690218dc818a11ab
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>
sound/soc/fsl/fsl_micfil.c