Unverified Commit 15b5221d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

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

parents d89af4ae a4d51cc7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -241,8 +241,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);

	list_for_each_entry(azx_dev, &bus->stream_list, list) {
		if (azx_dev->direction != substream->stream)