]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: meson: g12a-tohdmitx: Validate written enum values
authorMark Brown <broonie@kernel.org>
Wed, 3 Jan 2024 18:34:02 +0000 (18:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Jan 2024 17:48:05 +0000 (18:48 +0100)
commit51e88b2cef122ef2a7e3f5707e9cc062672d05cd
tree5efbe628ee0af6a13bb368d28db5b7fc4b4c5d21
parent85f8d007deabbfdd51b640c6741defc7f57ec06f
ASoC: meson: g12a-tohdmitx: Validate written enum values

[ Upstream commit 1e001206804be3f3d21f4a1cf16e5d059d75643f ]

When writing to an enum we need to verify that the value written is valid
for the enumeration, the helper function snd_soc_item_enum_to_val() doesn't
do it since it needs to return an unsigned (and in any case we'd need to
check the return value).

Fixes: c8609f3870f7 ("ASoC: meson: add g12a tohdmitx control")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240103-meson-enum-val-v1-2-424af7a8fb91@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/meson/g12a-tohdmitx.c