mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
ASoC: fsl_easrc: Check the variable range in fsl_easrc_iec958_put_bits()
Add check of input value's range in fsl_easrc_iec958_put_bits(),
otherwise the wrong value may be written from user space.
Fixes: 955ac62405 ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20260401094226.2900532-10-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
64a496ba97
commit
00541b86fb
|
|
@ -54,6 +54,9 @@ static int fsl_easrc_iec958_put_bits(struct snd_kcontrol *kcontrol,
|
|||
unsigned int regval = ucontrol->value.integer.value[0];
|
||||
int ret;
|
||||
|
||||
if (regval < EASRC_WIDTH_16_BIT || regval > EASRC_WIDTH_24_BIT)
|
||||
return -EINVAL;
|
||||
|
||||
ret = (easrc_priv->bps_iec958[mc->regbase] != regval);
|
||||
|
||||
easrc_priv->bps_iec958[mc->regbase] = regval;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user