Skip to content

Commit

Permalink
PCI: Be a bit defensive in quirk_nvidia_ck804() so we don't risk dere…
Browse files Browse the repository at this point in the history
…ferencing a NULL pdev.

pci_get_slot() may return NULL if nothing was found.  quirk_nvidia_ck804()
does not check the value returned from pci_get_slot(), so it may end up
causing a NULL pointer deref.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jesper Juhl authored and Greg Kroah-Hartman committed Dec 20, 2006
1 parent 1597cac commit 9ac0ce8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,8 @@ static void __devinit quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev)
* a single one having MSI is enough to be sure that MSI are supported.
*/
pdev = pci_get_slot(dev->bus, 0);
if (!pdev)
return;
if (!msi_ht_cap_enabled(dev) && !msi_ht_cap_enabled(pdev)) {
printk(KERN_WARNING "PCI: MSI quirk detected. "
"MSI disabled on chipset %s.\n",
Expand Down

0 comments on commit 9ac0ce8

Please sign in to comment.