Patch "ASoC: ops: Fix bounds check for _sx controls" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ASoC: ops: Fix bounds check for _sx controls

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-ops-fix-bounds-check-for-_sx-controls.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fe0bc28b7cf4f765ad2632f0f5947bfc10444c46
Author: Mark Brown <broonie@xxxxxxxxxx>
Date:   Wed May 11 14:41:36 2022 +0100

    ASoC: ops: Fix bounds check for _sx controls
    
    [ Upstream commit 698813ba8c580efb356ace8dbf55f61dac6063a8 ]
    
    For _sx controls the semantics of the max field is not the usual one, max
    is the number of steps rather than the maximum value. This means that our
    check in snd_soc_put_volsw_sx() needs to just check against the maximum
    value.
    
    Fixes: 4f1e50d6a9cf9c1b ("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx()")
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220511134137.169575-1-broonie@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index e73360e9de8f..b8a169d3b830 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -433,7 +433,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
 	val = ucontrol->value.integer.value[0];
 	if (mc->platform_max && val > mc->platform_max)
 		return -EINVAL;
-	if (val > max - min)
+	if (val > max)
 		return -EINVAL;
 	if (val < 0)
 		return -EINVAL;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux