Skip to content

Commit 2cd06bc

Browse files
committed
Merge tag 'asoc-fix-v6.7-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.7 I recently got a LibreTech Sapphire board for my CI and while integrating it found and fixed some issues, including crashes for the enum validation. There's also a couple of patches adding quirks for another x86 laptop from Hans and an error handling fix for the Freescale rpmsg driver.
2 parents c344ef3 + b036d8e commit 2cd06bc

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

sound/soc/fsl/fsl_rpmsg.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static int fsl_rpmsg_probe(struct platform_device *pdev)
238238
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component,
239239
&fsl_rpmsg_dai, 1);
240240
if (ret)
241-
return ret;
241+
goto err_pm_disable;
242242

243243
rpmsg->card_pdev = platform_device_register_data(&pdev->dev,
244244
"imx-audio-rpmsg",
@@ -248,16 +248,22 @@ static int fsl_rpmsg_probe(struct platform_device *pdev)
248248
if (IS_ERR(rpmsg->card_pdev)) {
249249
dev_err(&pdev->dev, "failed to register rpmsg card\n");
250250
ret = PTR_ERR(rpmsg->card_pdev);
251-
return ret;
251+
goto err_pm_disable;
252252
}
253253

254254
return 0;
255+
256+
err_pm_disable:
257+
pm_runtime_disable(&pdev->dev);
258+
return ret;
255259
}
256260

257261
static void fsl_rpmsg_remove(struct platform_device *pdev)
258262
{
259263
struct fsl_rpmsg *rpmsg = platform_get_drvdata(pdev);
260264

265+
pm_runtime_disable(&pdev->dev);
266+
261267
if (rpmsg->card_pdev)
262268
platform_device_unregister(rpmsg->card_pdev);
263269
}

sound/soc/mediatek/mt8186/mt8186-dai-adda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ static const struct snd_soc_dapm_widget mtk_dai_adda_widgets[] = {
499499
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
500500

501501
SND_SOC_DAPM_SUPPLY_S("AUD_PAD_TOP", SUPPLY_SEQ_ADDA_AUD_PAD_TOP,
502-
0, 0, 0,
502+
AFE_AUD_PAD_TOP, RG_RX_FIFO_ON_SFT, 0,
503503
mtk_adda_pad_top_event,
504504
SND_SOC_DAPM_PRE_PMU),
505505
SND_SOC_DAPM_SUPPLY_S("ADDA_MTKAIF_CFG", SUPPLY_SEQ_ADDA_MTKAIF_CFG,

sound/soc/meson/g12a-toacodec.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol,
7171
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
7272
unsigned int mux, reg;
7373

74+
if (ucontrol->value.enumerated.item[0] >= e->items)
75+
return -EINVAL;
76+
7477
mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]);
7578
regmap_field_read(priv->field_dat_sel, &reg);
7679

@@ -101,7 +104,7 @@ static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol,
101104

102105
snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
103106

104-
return 0;
107+
return 1;
105108
}
106109

107110
static SOC_ENUM_SINGLE_DECL(g12a_toacodec_mux_enum, TOACODEC_CTRL0,

sound/soc/meson/g12a-tohdmitx.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ static int g12a_tohdmitx_i2s_mux_put_enum(struct snd_kcontrol *kcontrol,
4545
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
4646
unsigned int mux, changed;
4747

48+
if (ucontrol->value.enumerated.item[0] >= e->items)
49+
return -EINVAL;
50+
4851
mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]);
4952
changed = snd_soc_component_test_bits(component, e->reg,
5053
CTRL0_I2S_DAT_SEL,
@@ -93,6 +96,9 @@ static int g12a_tohdmitx_spdif_mux_put_enum(struct snd_kcontrol *kcontrol,
9396
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
9497
unsigned int mux, changed;
9598

99+
if (ucontrol->value.enumerated.item[0] >= e->items)
100+
return -EINVAL;
101+
96102
mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]);
97103
changed = snd_soc_component_test_bits(component, TOHDMITX_CTRL0,
98104
CTRL0_SPDIF_SEL,
@@ -112,7 +118,7 @@ static int g12a_tohdmitx_spdif_mux_put_enum(struct snd_kcontrol *kcontrol,
112118

113119
snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
114120

115-
return 0;
121+
return 1;
116122
}
117123

118124
static SOC_ENUM_SINGLE_DECL(g12a_tohdmitx_spdif_mux_enum, TOHDMITX_CTRL0,

0 commit comments

Comments
 (0)