Skip to content

Commit

Permalink
ALSA: Allow pass NULL dev for snd_pci_quirk_lookup()
Browse files Browse the repository at this point in the history
Add a NULL check in snd_pci_quirk_lookup() so that NULL can be passed
as a pci_dev pointer.  This fixes the possible NULL dereferences in
HD-audio drivers.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Oct 8, 2014
1 parent 6d16941 commit e5b50ad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/core/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ EXPORT_SYMBOL(snd_pci_quirk_lookup_id);
const struct snd_pci_quirk *
snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list)
{
if (!pci)
return NULL;
return snd_pci_quirk_lookup_id(pci->subsystem_vendor,
pci->subsystem_device,
list);
Expand Down

0 comments on commit e5b50ad

Please sign in to comment.