Skip to content

Commit 5e95717

Browse files
Pei Xiaotiwai
authored andcommitted
ALSA: usb: qcom: fix NULL pointer dereference in qmi_stop_session
The find_substream() call may return NULL, but the error path dereferenced 'subs' unconditionally via dev_err(&subs->dev->dev, ...), causing a NULL pointer dereference when subs is NULL. Fix by switching to &uadev[idx].udev->dev which is always valid in this context. Signed-off-by: Pei Xiao <[email protected]> Link: https://patch.msgid.link/86ac2939273ac853535049e60391c09d7688714e.1750755508.git.xiaopei01@kylinos.cn Signed-off-by: Takashi Iwai <[email protected]>
1 parent b272f42 commit 5e95717

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/usb/qcom/qc_audio_offload.c

Lines changed: 1 addition & 1 deletion
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,

0 commit comments

Comments
 (0)