Unverified Commit 8b164093 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8224 ALSA: hda: Fix possible null-ptr-deref when assigning a stream

parents 720df5e6 3ef83126
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -293,8 +293,10 @@ struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus,
	struct hdac_stream *res = NULL;

	/* make a non-zero unique key for the substream */
	int key = (substream->pcm->device << 16) | (substream->number << 2) |
		(substream->stream + 1);
	int key = (substream->number << 2) | (substream->stream + 1);

	if (substream->pcm)
		key |= (substream->pcm->device << 16);

	spin_lock_irq(&bus->reg_lock);
	list_for_each_entry(azx_dev, &bus->stream_list, list) {