stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.15 01/28] ASoC: ops: Fix off by one in range control validation
@ 2022-07-14  4:24 Sasha Levin
  2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 02/28] pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux() Sasha Levin
                   ` (26 more replies)
  0 siblings, 27 replies; 30+ messages in thread
From: Sasha Levin @ 2022-07-14  4:24 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Mark Brown, Sasha Levin, lgirdwood, perex, tiwai, alsa-devel

From: Mark Brown <broonie@kernel.org>

[ Upstream commit 5871321fb4558c55bf9567052b618ff0be6b975e ]

We currently report that range controls accept a range of 0..(max-min) but
accept writes in the range 0..(max-min+1). Remove that extra +1.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220604105246.4055214-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/soc-ops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index f32ba64c5dda..e73360e9de8f 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -526,7 +526,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
 		return -EINVAL;
 	if (mc->platform_max && tmp > mc->platform_max)
 		return -EINVAL;
-	if (tmp > mc->max - mc->min + 1)
+	if (tmp > mc->max - mc->min)
 		return -EINVAL;
 
 	if (invert)
@@ -547,7 +547,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
 			return -EINVAL;
 		if (mc->platform_max && tmp > mc->platform_max)
 			return -EINVAL;
-		if (tmp > mc->max - mc->min + 1)
+		if (tmp > mc->max - mc->min)
 			return -EINVAL;
 
 		if (invert)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-07-17 23:04 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-14  4:24 [PATCH AUTOSEL 5.15 01/28] ASoC: ops: Fix off by one in range control validation Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 02/28] pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux() Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 03/28] ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 04/28] ASoC: rt711-sdca-sdw: fix calibrate mutex initialization Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 05/28] ASoC: Intel: sof_sdw: handle errors on card registration Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 06/28] ASoC: rt711: fix calibrate mutex initialization Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 07/28] ASoC: rt7*-sdw: harden jack_detect_handler Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 08/28] ASoC: codecs: rt700/rt711/rt711-sdca: initialize workqueues in probe Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 09/28] ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 10/28] ASoC: wcd938x: Fix event generation for some controls Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 11/28] ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 12/28] ASoC: rockchip: i2s: switch BCLK to GPIO Sasha Levin
2022-07-14  4:29   ` Chen-Yu Tsai
2022-07-17 23:04     ` Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 13/28] ASoC: wm5110: Fix DRE control Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 14/28] ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 15/28] ASoC: dapm: Initialise kcontrol data for mux/demux controls Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 16/28] ASoC: cs47l15: Fix event generation for low power mux control Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 17/28] ASoC: madera: Fix event generation for OUT1 demux Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 18/28] ASoC: madera: Fix event generation for rate controls Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 19/28] irqchip: or1k-pic: Undefine mask_ack for level triggered hardware Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 20/28] x86: Clear .brk area at early boot Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 21/28] soc: ixp4xx/npe: Fix unused match warning Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 22/28] ARM: dts: stm32: use the correct clock source for CEC on stm32mp151 Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 23/28] Revert "can: xilinx_can: Limit CANFD brp to 2" Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 24/28] ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 25/28] ALSA: usb-audio: Add quirk for Fiero SC-01 Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 26/28] ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0) Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 27/28] nvme-pci: phison e16 has bogus namespace ids Sasha Levin
2022-07-14  4:24 ` [PATCH AUTOSEL 5.15 28/28] signal handling: don't use BUG_ON() for debugging Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).