Skip to content

Commit 9c2f970

Browse files
committed
Merge tag 'sound-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small fixes again: - A regression fix for hibernation bug in ASoC SoundWire - Fixes for the new Qualcomm USB offload stuff - A potential OOB access fix in USB-audio - A potential memleadk fix in ASoC Intel - Quirks for HD-audio and ASoC AMD ACP" * tag 'sound-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek: Fix built-in mic on ASUS VivoBook X507UAR ALSA: usb: qcom: fix NULL pointer dereference in qmi_stop_session ASoC: SOF: Intel: hda: Use devm_kstrdup() to avoid memleak. ASoC: rt721-sdca: fix boost gain calculation error ALSA: qc_audio_offload: Fix missing error code in prepare_qmi_response() ALSA: hda/realtek: Add mic-mute LED setup for ASUS UM5606 ALSA: usb-audio: Fix out-of-bounds read in snd_usb_get_audioformat_uac3() ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook 6 G1a ASoC: amd: ps: fix for soundwire failures during hibernation exit sequence ASoC: amd: yc: Add DMI quirk for Lenovo IdeaPad Slim 5 15 ASoC: amd: yc: add quirk for Acer Nitro ANV15-41 internal mic ASoC: qcom: sm8250: Fix possibly undefined reference ALSA: hda/realtek - Enable mute LED on HP Pavilion Laptop 15-eg100 ALSA: hda/realtek: Add quirks for some Clevo laptops
2 parents 67a9938 + 7ab6847 commit 9c2f970

File tree

9 files changed

+79
-15
lines changed

9 files changed

+79
-15
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,6 +2656,7 @@ static const struct hda_quirk alc882_fixup_tbl[] = {
26562656
SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
26572657
SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
26582658
SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2659+
SND_PCI_QUIRK(0x1558, 0x5802, "Clevo X58[05]WN[RST]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
26592660
SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
26602661
SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
26612662
SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
@@ -6609,6 +6610,7 @@ static void alc294_fixup_bass_speaker_15(struct hda_codec *codec,
66096610
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
66106611
static const hda_nid_t conn[] = { 0x02, 0x03 };
66116612
snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
6613+
snd_hda_gen_add_micmute_led_cdev(codec, NULL);
66126614
}
66136615
}
66146616

@@ -10737,6 +10739,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1073710739
SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
1073810740
SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
1073910741
SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
10742+
SND_PCI_QUIRK(0x103c, 0x898a, "HP Pavilion 15-eg100", ALC287_FIXUP_HP_GPIO_LED),
1074010743
SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
1074110744
SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
1074210745
SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
@@ -10907,7 +10910,9 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1090710910
SND_PCI_QUIRK(0x103c, 0x8def, "HP EliteBook 660 G12", ALC236_FIXUP_HP_GPIO_LED),
1090810911
SND_PCI_QUIRK(0x103c, 0x8df0, "HP EliteBook 630 G12", ALC236_FIXUP_HP_GPIO_LED),
1090910912
SND_PCI_QUIRK(0x103c, 0x8df1, "HP EliteBook 630 G12", ALC236_FIXUP_HP_GPIO_LED),
10913+
SND_PCI_QUIRK(0x103c, 0x8dfb, "HP EliteBook 6 G1a 14", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
1091010914
SND_PCI_QUIRK(0x103c, 0x8dfc, "HP EliteBook 645 G12", ALC236_FIXUP_HP_GPIO_LED),
10915+
SND_PCI_QUIRK(0x103c, 0x8dfd, "HP EliteBook 6 G1a 16", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
1091110916
SND_PCI_QUIRK(0x103c, 0x8dfe, "HP EliteBook 665 G12", ALC236_FIXUP_HP_GPIO_LED),
1091210917
SND_PCI_QUIRK(0x103c, 0x8e11, "HP Trekker", ALC287_FIXUP_CS35L41_I2C_2),
1091310918
SND_PCI_QUIRK(0x103c, 0x8e12, "HP Trekker", ALC287_FIXUP_CS35L41_I2C_2),
@@ -11026,6 +11031,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1102611031
SND_PCI_QUIRK(0x1043, 0x1df3, "ASUS UM5606WA", ALC294_FIXUP_BASS_SPEAKER_15),
1102711032
SND_PCI_QUIRK(0x1043, 0x1264, "ASUS UM5606KA", ALC294_FIXUP_BASS_SPEAKER_15),
1102811033
SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
11034+
SND_PCI_QUIRK(0x1043, 0x1e10, "ASUS VivoBook X507UAR", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
1102911035
SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
1103011036
SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
1103111037
SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC),
@@ -11135,6 +11141,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1113511141
SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1113611142
SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1113711143
SND_PCI_QUIRK(0x1558, 0x28c1, "Clevo V370VND", ALC2XX_FIXUP_HEADSET_MIC),
11144+
SND_PCI_QUIRK(0x1558, 0x35a1, "Clevo V3[56]0EN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11145+
SND_PCI_QUIRK(0x1558, 0x35b1, "Clevo V3[57]0WN[MNP]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1113811146
SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1113911147
SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1114011148
SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
@@ -11162,6 +11170,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1116211170
SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1116311171
SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1116411172
SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11173+
SND_PCI_QUIRK(0x1558, 0x5700, "Clevo X560WN[RST]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1116511174
SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1116611175
SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1116711176
SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
@@ -11201,6 +11210,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1120111210
SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1120211211
SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1120311212
SND_PCI_QUIRK(0x1558, 0xa741, "Clevo V54x_6x_TNE", ALC245_FIXUP_CLEVO_NOISY_MIC),
11213+
SND_PCI_QUIRK(0x1558, 0xa743, "Clevo V54x_6x_TU", ALC245_FIXUP_CLEVO_NOISY_MIC),
1120411214
SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC245_FIXUP_CLEVO_NOISY_MIC),
1120511215
SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1120611216
SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),

sound/soc/amd/ps/acp63.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ struct acp_hw_ops {
334334
* @addr: pci ioremap address
335335
* @reg_range: ACP reigister range
336336
* @acp_rev: ACP PCI revision id
337+
* @acp_sw_pad_keeper_en: store acp SoundWire pad keeper enable register value
338+
* @acp_pad_pulldown_ctrl: store acp pad pulldown control register value
337339
* @acp63_sdw0-dma_intr_stat: DMA interrupt status array for ACP6.3 platform SoundWire
338340
* manager-SW0 instance
339341
* @acp63_sdw_dma_intr_stat: DMA interrupt status array for ACP6.3 platform SoundWire
@@ -367,6 +369,8 @@ struct acp63_dev_data {
367369
u32 addr;
368370
u32 reg_range;
369371
u32 acp_rev;
372+
u32 acp_sw_pad_keeper_en;
373+
u32 acp_pad_pulldown_ctrl;
370374
u16 acp63_sdw0_dma_intr_stat[ACP63_SDW0_DMA_MAX_STREAMS];
371375
u16 acp63_sdw1_dma_intr_stat[ACP63_SDW1_DMA_MAX_STREAMS];
372376
u16 acp70_sdw0_dma_intr_stat[ACP70_SDW0_DMA_MAX_STREAMS];

sound/soc/amd/ps/ps-common.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ static int __maybe_unused snd_acp63_suspend(struct device *dev)
160160

161161
adata = dev_get_drvdata(dev);
162162
if (adata->is_sdw_dev) {
163+
adata->acp_sw_pad_keeper_en = readl(adata->acp63_base + ACP_SW0_PAD_KEEPER_EN);
164+
adata->acp_pad_pulldown_ctrl = readl(adata->acp63_base + ACP_PAD_PULLDOWN_CTRL);
163165
adata->sdw_en_stat = check_acp_sdw_enable_status(adata);
164166
if (adata->sdw_en_stat) {
165167
writel(1, adata->acp63_base + ACP_ZSC_DSP_CTRL);
@@ -197,6 +199,7 @@ static int __maybe_unused snd_acp63_runtime_resume(struct device *dev)
197199
static int __maybe_unused snd_acp63_resume(struct device *dev)
198200
{
199201
struct acp63_dev_data *adata;
202+
u32 acp_sw_pad_keeper_en;
200203
int ret;
201204

202205
adata = dev_get_drvdata(dev);
@@ -209,6 +212,12 @@ static int __maybe_unused snd_acp63_resume(struct device *dev)
209212
if (ret)
210213
dev_err(dev, "ACP init failed\n");
211214

215+
acp_sw_pad_keeper_en = readl(adata->acp63_base + ACP_SW0_PAD_KEEPER_EN);
216+
dev_dbg(dev, "ACP_SW0_PAD_KEEPER_EN:0x%x\n", acp_sw_pad_keeper_en);
217+
if (!acp_sw_pad_keeper_en) {
218+
writel(adata->acp_sw_pad_keeper_en, adata->acp63_base + ACP_SW0_PAD_KEEPER_EN);
219+
writel(adata->acp_pad_pulldown_ctrl, adata->acp63_base + ACP_PAD_PULLDOWN_CTRL);
220+
}
212221
return ret;
213222
}
214223

@@ -408,6 +417,8 @@ static int __maybe_unused snd_acp70_suspend(struct device *dev)
408417

409418
adata = dev_get_drvdata(dev);
410419
if (adata->is_sdw_dev) {
420+
adata->acp_sw_pad_keeper_en = readl(adata->acp63_base + ACP_SW0_PAD_KEEPER_EN);
421+
adata->acp_pad_pulldown_ctrl = readl(adata->acp63_base + ACP_PAD_PULLDOWN_CTRL);
411422
adata->sdw_en_stat = check_acp_sdw_enable_status(adata);
412423
if (adata->sdw_en_stat) {
413424
writel(1, adata->acp63_base + ACP_ZSC_DSP_CTRL);
@@ -445,6 +456,7 @@ static int __maybe_unused snd_acp70_runtime_resume(struct device *dev)
445456
static int __maybe_unused snd_acp70_resume(struct device *dev)
446457
{
447458
struct acp63_dev_data *adata;
459+
u32 acp_sw_pad_keeper_en;
448460
int ret;
449461

450462
adata = dev_get_drvdata(dev);
@@ -459,6 +471,12 @@ static int __maybe_unused snd_acp70_resume(struct device *dev)
459471
if (ret)
460472
dev_err(dev, "ACP init failed\n");
461473

474+
acp_sw_pad_keeper_en = readl(adata->acp63_base + ACP_SW0_PAD_KEEPER_EN);
475+
dev_dbg(dev, "ACP_SW0_PAD_KEEPER_EN:0x%x\n", acp_sw_pad_keeper_en);
476+
if (!acp_sw_pad_keeper_en) {
477+
writel(adata->acp_sw_pad_keeper_en, adata->acp63_base + ACP_SW0_PAD_KEEPER_EN);
478+
writel(adata->acp_pad_pulldown_ctrl, adata->acp63_base + ACP_PAD_PULLDOWN_CTRL);
479+
}
462480
return ret;
463481
}
464482

sound/soc/amd/yc/acp6x-mach.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,27 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
353353
DMI_MATCH(DMI_PRODUCT_NAME, "83Q3"),
354354
}
355355
},
356+
{
357+
.driver_data = &acp6x_card,
358+
.matches = {
359+
DMI_MATCH(DMI_BOARD_VENDOR, "RB"),
360+
DMI_MATCH(DMI_PRODUCT_NAME, "Nitro ANV15-41"),
361+
}
362+
},
356363
{
357364
.driver_data = &acp6x_card,
358365
.matches = {
359366
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
360367
DMI_MATCH(DMI_PRODUCT_NAME, "83J2"),
361368
}
362369
},
370+
{
371+
.driver_data = &acp6x_card,
372+
.matches = {
373+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
374+
DMI_MATCH(DMI_PRODUCT_NAME, "83J3"),
375+
}
376+
},
363377
{
364378
.driver_data = &acp6x_card,
365379
.matches = {

sound/soc/codecs/rt721-sdca.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ static int rt721_sdca_set_gain_get(struct snd_kcontrol *kcontrol,
430430
unsigned int read_l, read_r, ctl_l = 0, ctl_r = 0;
431431
unsigned int adc_vol_flag = 0;
432432
const unsigned int interval_offset = 0xc0;
433+
const unsigned int tendA = 0x200;
433434
const unsigned int tendB = 0xa00;
434435

435436
if (strstr(ucontrol->id.name, "FU1E Capture Volume") ||
@@ -439,19 +440,33 @@ static int rt721_sdca_set_gain_get(struct snd_kcontrol *kcontrol,
439440
regmap_read(rt721->mbq_regmap, mc->reg, &read_l);
440441
regmap_read(rt721->mbq_regmap, mc->rreg, &read_r);
441442

442-
if (mc->shift == 8) /* boost gain */
443+
if (mc->shift == 8) {
444+
/* boost gain */
443445
ctl_l = read_l / tendB;
444-
else {
446+
} else if (mc->shift == 1) {
447+
/* FU33 boost gain */
448+
if (read_l == 0x8000 || read_l == 0xfe00)
449+
ctl_l = 0;
450+
else
451+
ctl_l = read_l / tendA + 1;
452+
} else {
445453
if (adc_vol_flag)
446454
ctl_l = mc->max - (((0x1e00 - read_l) & 0xffff) / interval_offset);
447455
else
448456
ctl_l = mc->max - (((0 - read_l) & 0xffff) / interval_offset);
449457
}
450458

451459
if (read_l != read_r) {
452-
if (mc->shift == 8) /* boost gain */
460+
if (mc->shift == 8) {
461+
/* boost gain */
453462
ctl_r = read_r / tendB;
454-
else { /* ADC/DAC gain */
463+
} else if (mc->shift == 1) {
464+
/* FU33 boost gain */
465+
if (read_r == 0x8000 || read_r == 0xfe00)
466+
ctl_r = 0;
467+
else
468+
ctl_r = read_r / tendA + 1;
469+
} else { /* ADC/DAC gain */
455470
if (adc_vol_flag)
456471
ctl_r = mc->max - (((0x1e00 - read_r) & 0xffff) / interval_offset);
457472
else

sound/soc/qcom/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ config SND_SOC_SM8250
186186
tristate "SoC Machine driver for SM8250 boards"
187187
depends on QCOM_APR && SOUNDWIRE
188188
depends on COMMON_CLK
189+
depends on SND_SOC_QCOM_OFFLOAD_UTILS || !SND_SOC_QCOM_OFFLOAD_UTILS
189190
select SND_SOC_QDSP6
190191
select SND_SOC_QCOM_COMMON
191192
select SND_SOC_QCOM_SDW

sound/soc/sof/intel/hda.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,11 +1257,11 @@ static int check_tplg_quirk_mask(struct snd_soc_acpi_mach *mach)
12571257
return 0;
12581258
}
12591259

1260-
static char *remove_file_ext(const char *tplg_filename)
1260+
static char *remove_file_ext(struct device *dev, const char *tplg_filename)
12611261
{
12621262
char *filename, *tmp;
12631263

1264-
filename = kstrdup(tplg_filename, GFP_KERNEL);
1264+
filename = devm_kstrdup(dev, tplg_filename, GFP_KERNEL);
12651265
if (!filename)
12661266
return NULL;
12671267

@@ -1345,7 +1345,7 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
13451345
*/
13461346
if (!sof_pdata->tplg_filename) {
13471347
/* remove file extension if it exists */
1348-
tplg_filename = remove_file_ext(mach->sof_tplg_filename);
1348+
tplg_filename = remove_file_ext(sdev->dev, mach->sof_tplg_filename);
13491349
if (!tplg_filename)
13501350
return NULL;
13511351

sound/usb/qcom/qc_audio_offload.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ static void qmi_stop_session(void)
759759
subs = find_substream(pcm_card_num, info->pcm_dev_num,
760760
info->direction);
761761
if (!subs || !chip || atomic_read(&chip->shutdown)) {
762-
dev_err(&subs->dev->dev,
762+
dev_err(&uadev[idx].udev->dev,
763763
"no sub for c#%u dev#%u dir%u\n",
764764
info->pcm_card_num,
765765
info->pcm_dev_num,
@@ -1360,20 +1360,21 @@ static int prepare_qmi_response(struct snd_usb_substream *subs,
13601360

13611361
if (!uadev[card_num].ctrl_intf) {
13621362
dev_err(&subs->dev->dev, "audio ctrl intf info not cached\n");
1363-
ret = -ENODEV;
1364-
goto err;
1363+
return -ENODEV;
13651364
}
13661365

13671366
ret = uaudio_populate_uac_desc(subs, resp);
13681367
if (ret < 0)
1369-
goto err;
1368+
return ret;
13701369

13711370
resp->slot_id = subs->dev->slot_id;
13721371
resp->slot_id_valid = 1;
13731372

13741373
data = snd_soc_usb_find_priv_data(uaudio_qdev->auxdev->dev.parent);
1375-
if (!data)
1376-
goto err;
1374+
if (!data) {
1375+
dev_err(&subs->dev->dev, "No private data found\n");
1376+
return -ENODEV;
1377+
}
13771378

13781379
uaudio_qdev->data = data;
13791380

@@ -1382,7 +1383,7 @@ static int prepare_qmi_response(struct snd_usb_substream *subs,
13821383
&resp->xhci_mem_info.tr_data,
13831384
&resp->std_as_data_ep_desc);
13841385
if (ret < 0)
1385-
goto err;
1386+
return ret;
13861387

13871388
resp->std_as_data_ep_desc_valid = 1;
13881389

@@ -1500,7 +1501,6 @@ static int prepare_qmi_response(struct snd_usb_substream *subs,
15001501
xhci_sideband_remove_endpoint(uadev[card_num].sb,
15011502
usb_pipe_endpoint(subs->dev, subs->data_endpoint->pipe));
15021503

1503-
err:
15041504
return ret;
15051505
}
15061506

sound/usb/stream.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,8 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip,
987987
* and request Cluster Descriptor
988988
*/
989989
wLength = le16_to_cpu(hc_header.wLength);
990+
if (wLength < sizeof(cluster))
991+
return NULL;
990992
cluster = kzalloc(wLength, GFP_KERNEL);
991993
if (!cluster)
992994
return ERR_PTR(-ENOMEM);

0 commit comments

Comments
 (0)