summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlavin Liu <bolin.liu@seu.edu.cn>2026-09-13 20:51:54 +0800
committerTakashi Iwai <tiwai@suse.de>2026-09-14 18:09:41 +0200
commitc9e6e5f38bf75276605f1952b22285f5f3abcaff (patch)
treeba1a207b58ba6b704d7b456d6538158bcbbd56f3
parent5ab3dc647751996784cff20a51f3730f4e88afe4 (diff)
downloadlinux-c9e6e5f38bf75276605f1952b22285f5f3abcaff.tar.gz
linux-c9e6e5f38bf75276605f1952b22285f5f3abcaff.zip
ALSA: hda: trace PCM open only after assigning a stream
Stream assignment can fail when hardware streams are exhausted. Move the tracepoint after the NULL check because its payload accesses the assigned stream tag. Detected by static analysis and reviewed with AI-assisted source auditing. Fixes: 184865085b88 ("ALSA: hda - rename hda_intel_trace.h to hda_controller_trace.h") Assisted-by: LLM Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn> Link: https://patch.msgid.link/20260913125154.109944-1-bolin.liu@seu.edu.cn Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/hda/common/controller.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/hda/common/controller.c b/sound/hda/common/controller.c
index afec5c5546ec..18dae022b324 100644
--- a/sound/hda/common/controller.c
+++ b/sound/hda/common/controller.c
@@ -586,11 +586,11 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
snd_hda_codec_pcm_get(apcm->info);
mutex_lock(&chip->open_mutex);
azx_dev = azx_assign_device(chip, substream);
- trace_azx_pcm_open(chip, azx_dev);
if (azx_dev == NULL) {
err = -EBUSY;
goto unlock;
}
+ trace_azx_pcm_open(chip, azx_dev);
runtime->private_data = azx_dev;
runtime->hw = azx_pcm_hw;