ASoC: max98090: Reject invalid values in custom control put()
authorMark Brown <broonie@kernel.org>
Wed, 20 Apr 2022 19:34:53 +0000 (20:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 May 2022 08:26:52 +0000 (10:26 +0200)
commit081188d82e5b355fcab88073cf6dd46f41867ea7
tree0e5df8517794c43dc8b981fa281384392aa41db6
parente1d387eead8bc91c59a11569ee36150aebc4382a
ASoC: max98090: Reject invalid values in custom control put()

[ Upstream commit 2fbe467bcbfc760a08f08475eea6bbd4c2874319 ]

The max98090 driver has a custom put function for some controls which can
only be updated in certain circumstances which makes no effort to validate
that input is suitable for the control, allowing out of spec values to be
written to the hardware and presented to userspace. Fix this by returning
an error when invalid values are written.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220420193454.2647908-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/max98090.c