Skip to content

Commit ce345f1

Browse files
committed
Merge tag 'asoc-fix-v5.17-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.17 A few more fixes for v5.17, one followup to the bounds checking fixes handling controls which support negative values internally and a driver specific one.
2 parents c22a808 + c5487b9 commit ce345f1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

sound/soc/codecs/cs4265.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ static const struct snd_kcontrol_new cs4265_snd_controls[] = {
150150
SOC_SINGLE("E to F Buffer Disable Switch", CS4265_SPDIF_CTL1,
151151
6, 1, 0),
152152
SOC_ENUM("C Data Access", cam_mode_enum),
153-
SOC_SINGLE("SPDIF Switch", CS4265_SPDIF_CTL2, 5, 1, 1),
154153
SOC_SINGLE("Validity Bit Control Switch", CS4265_SPDIF_CTL2,
155154
3, 1, 0),
156155
SOC_ENUM("SPDIF Mono/Stereo", spdif_mono_stereo_enum),
@@ -186,7 +185,7 @@ static const struct snd_soc_dapm_widget cs4265_dapm_widgets[] = {
186185

187186
SND_SOC_DAPM_SWITCH("Loopback", SND_SOC_NOPM, 0, 0,
188187
&loopback_ctl),
189-
SND_SOC_DAPM_SWITCH("SPDIF", SND_SOC_NOPM, 0, 0,
188+
SND_SOC_DAPM_SWITCH("SPDIF", CS4265_SPDIF_CTL2, 5, 1,
190189
&spdif_switch),
191190
SND_SOC_DAPM_SWITCH("DAC", CS4265_PWRCTL, 1, 1,
192191
&dac_switch),

sound/soc/soc-ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
319319
if (ucontrol->value.integer.value[0] < 0)
320320
return -EINVAL;
321321
val = ucontrol->value.integer.value[0];
322-
if (mc->platform_max && val > mc->platform_max)
322+
if (mc->platform_max && ((int)val + min) > mc->platform_max)
323323
return -EINVAL;
324324
if (val > max - min)
325325
return -EINVAL;
@@ -332,7 +332,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
332332
if (ucontrol->value.integer.value[1] < 0)
333333
return -EINVAL;
334334
val2 = ucontrol->value.integer.value[1];
335-
if (mc->platform_max && val2 > mc->platform_max)
335+
if (mc->platform_max && ((int)val2 + min) > mc->platform_max)
336336
return -EINVAL;
337337
if (val2 > max - min)
338338
return -EINVAL;

0 commit comments

Comments
 (0)