mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
ASoC: codecs: lpass-wsa-macro: Fix enum kcontrol accesses
commit56f24311fdupstream. EAR SPKR PA Gain" and the four "WSA RX* Mux" controls are enumerated, but their get and put callbacks access the value through ucontrol->value.integer.value[0] (a long) instead of ucontrol->value.enumerated.item[0] (an unsigned int). This same pattern was fixed in the sibling drivers by commitbcfe5f76cc("ASoC: codecs: rx-macro: fix accessing array out of bounds for enum type") and commit0ea5eff7c6("ASoC: codecs: va-macro: fix accessing array out of bounds for enum type"), but wsa-macro was missed. On 64-bit kernels with CONFIG_SND_CTL_DEBUG this trips the elem value sanity check and every read of these controls fails with -EINVAL. Fixes:809bcbcece("ASoC: codecs: lpass-wsa-macro: Add support to WSA Macro") Fixes:2c4066e5d4("ASoC: codecs: lpass-wsa-macro: add dapm widgets and route") Assisted-by: Claude:claude-fable-5 Cc: stable@vger.kernel.org Signed-off-by: Dawid Wróbel <me@dawidwrobel.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20260730-worktree-lpass-tx-macro-enum-fix-v2-2-6d091c736116@dawidwrobel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ad8b255006
commit
891129df5d
@@ -1859,7 +1859,7 @@ static int wsa_macro_ear_spkr_pa_gain_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
|
||||
struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
|
||||
|
||||
ucontrol->value.integer.value[0] = wsa->ear_spkr_gain;
|
||||
ucontrol->value.enumerated.item[0] = wsa->ear_spkr_gain;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1870,7 +1870,7 @@ static int wsa_macro_ear_spkr_pa_gain_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
|
||||
struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
|
||||
|
||||
wsa->ear_spkr_gain = ucontrol->value.integer.value[0];
|
||||
wsa->ear_spkr_gain = ucontrol->value.enumerated.item[0];
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1884,7 +1884,7 @@ static int wsa_macro_rx_mux_get(struct snd_kcontrol *kcontrol,
|
||||
snd_soc_dapm_to_component(widget->dapm);
|
||||
struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
|
||||
|
||||
ucontrol->value.integer.value[0] =
|
||||
ucontrol->value.enumerated.item[0] =
|
||||
wsa->rx_port_value[widget->shift];
|
||||
return 0;
|
||||
}
|
||||
@@ -1898,7 +1898,7 @@ static int wsa_macro_rx_mux_put(struct snd_kcontrol *kcontrol,
|
||||
snd_soc_dapm_to_component(widget->dapm);
|
||||
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
||||
struct snd_soc_dapm_update *update = NULL;
|
||||
u32 rx_port_value = ucontrol->value.integer.value[0];
|
||||
u32 rx_port_value = ucontrol->value.enumerated.item[0];
|
||||
u32 bit_input;
|
||||
u32 aif_rst;
|
||||
struct wsa_macro *wsa = snd_soc_component_get_drvdata(component);
|
||||
|
||||
Reference in New Issue
Block a user