From: Jesper Juhl <jesper.juhl@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Martin Mares <mj@ucw.cz>
Subject: [PATCH] Be a bit defensive in quirk_nvidia_ck804() so we don't risk dereferencing a NULL pdev.
Date: Sat, 2 Dec 2006 00:21:56 +0100 [thread overview]
Message-ID: <200612020021.56250.jesper.juhl@gmail.com> (raw)
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>
---
drivers/pci/quirks.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 5b44838..d3dcbda 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1741,6 +1741,8 @@ static void __devinit quirk_nvidia_ck804
* 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 (dev->subordinate && !msi_ht_cap_enabled(dev)
&& !msi_ht_cap_enabled(pdev)) {
printk(KERN_WARNING "PCI: MSI quirk detected. "
next reply other threads:[~2006-12-01 23:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-01 23:21 Jesper Juhl [this message]
2006-12-01 23:55 ` Alan
2006-12-02 0:59 ` David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200612020021.56250.jesper.juhl@gmail.com \
--to=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mj@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome