Skip to content

Commit c7e69ae

Browse files
Markus Osterhofftiwai
authored andcommitted
ALSA: hda: fix possible NULL dereference
After a for-loop was replaced by list_for_each_entry, see Commit bbbc7e8 ("ALSA: hda - Allocate hda_pcm objects dynamically"), Commit 751e221 ("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> Cc: <stable@vger.kernel.org> #v4.1+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent f6b28e4 commit c7e69ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/pci/hda/hda_codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3172,7 +3172,7 @@ static int add_std_chmaps(struct hda_codec *codec)
31723172
struct snd_pcm_chmap *chmap;
31733173
const struct snd_pcm_chmap_elem *elem;
31743174

3175-
if (!pcm || pcm->own_chmap ||
3175+
if (!pcm || !pcm->pcm || pcm->own_chmap ||
31763176
!hinfo->substreams)
31773177
continue;
31783178
elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;

0 commit comments

Comments
 (0)