summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMarkus Osterhoff <linux-kernel@k-raum.org>2015-08-24 14:11:39 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-13 09:07:48 -0700
commit360c2a1448754b76fbf742b6270f5da1d4db3700 (patch)
treea74a4b5c3469460c6883289245f431878c117dd7 /sound
parentac44e50e61aaa6ef939970ad1532ce7a274a0ca5 (diff)
ALSA: hda: fix possible NULL dereference
commit c7e69ae6b4ff49edf50180c0a32f3dd9d7967e31 upstream. After a for-loop was replaced by list_for_each_entry, see Commit bbbc7e8502c9 ("ALSA: hda - Allocate hda_pcm objects dynamically"), Commit 751e2216899c ("ALSA: hda: fix possible null dereference"), a possible NULL pointer dereference has been introduced; this patch adds the NULL check on pcm->pcm, while leaving a potentially superfluous check on pcm itself untouched. Signed-off-by: Markus Osterhoff <linux-kernel@k-raum.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 5645481af3d9..36e8f1236637 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -3259,7 +3259,7 @@ static int add_std_chmaps(struct hda_codec *codec)
struct snd_pcm_chmap *chmap;
const struct snd_pcm_chmap_elem *elem;
- if (!pcm || pcm->own_chmap ||
+ if (!pcm || !pcm->pcm || pcm->own_chmap ||
!hinfo->substreams)
continue;
elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;