Skip to content

Commit 57c14b9

Browse files
kkosik20tiwai
authored andcommitted
ALSA: usb-audio: Fix NULL pointer deref in snd_usb_power_domain_set()
Commit adding support for multiple control interfaces expanded struct snd_usb_power_domain with pointer to control interface for proper control message routing but missed one initialization point of this structure, which has left new field with NULL value. Standard mandates that each device has at least one control interface and code responsible for power domain does not check for NULL values when querying for control interface. This caused some USB devices to crash the kernel. Fixes: 6aa8700 ("ALSA: usb-audio: Support multiple control interfaces") Signed-off-by: Karol Kosik <[email protected]> Link: https://patch.msgid.link/AS8P190MB1285B563C6B5394DB274813FEC782@AS8P190MB1285.EURP190.PROD.OUTLOOK.COM Signed-off-by: Takashi Iwai <[email protected]>
1 parent 9988844 commit 57c14b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sound/usb/stream.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,7 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip,
10671067
UAC3_BADD_PD_ID10 : UAC3_BADD_PD_ID11;
10681068
pd->pd_d1d0_rec = UAC3_BADD_PD_RECOVER_D1D0;
10691069
pd->pd_d2d0_rec = UAC3_BADD_PD_RECOVER_D2D0;
1070+
pd->ctrl_iface = ctrl_intf;
10701071

10711072
} else {
10721073
fp->attributes = parse_uac_endpoint_attributes(chip, alts,

0 commit comments

Comments
 (0)