diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-08 06:08:38 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-08 06:08:38 -0400 |
commit | e5b50ada76f44c8742a123813689bff4db062a5a (patch) | |
tree | 44749468fa4996afa2cf33337be62f71ea447df8 /sound/core/misc.c | |
parent | 6d16941aee6eb468c5a5cc78ecbaf840f3e16df5 (diff) |
ALSA: Allow pass NULL dev for snd_pci_quirk_lookup()
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>
Diffstat (limited to 'sound/core/misc.c')
-rw-r--r-- | sound/core/misc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/misc.c b/sound/core/misc.c index 30e027ecf4da..f2e8226c88fb 100644 --- a/sound/core/misc.c +++ b/sound/core/misc.c | |||
@@ -145,6 +145,8 @@ EXPORT_SYMBOL(snd_pci_quirk_lookup_id); | |||
145 | const struct snd_pci_quirk * | 145 | const struct snd_pci_quirk * |
146 | snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list) | 146 | snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list) |
147 | { | 147 | { |
148 | if (!pci) | ||
149 | return NULL; | ||
148 | return snd_pci_quirk_lookup_id(pci->subsystem_vendor, | 150 | return snd_pci_quirk_lookup_id(pci->subsystem_vendor, |
149 | pci->subsystem_device, | 151 | pci->subsystem_device, |
150 | list); | 152 | list); |