public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: greg@kroah.com
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Use before NULL check in shpchp_ctrl
Date: Fri, 3 Sep 2004 22:10:58 +0100	[thread overview]
Message-ID: <20040903211058.GW26419@redhat.com> (raw)

More fun found with the coverity checker.

Signed-off-by: Dave Jones <davej@redhat.com>


--- linux-2.6.8/drivers/pci/hotplug/shpchp_ctrl.c~	2004-09-03 22:08:33.285172888 +0100
+++ linux-2.6.8/drivers/pci/hotplug/shpchp_ctrl.c	2004-09-03 22:09:41.390819256 +0100
@@ -2163,12 +2163,14 @@
 	u32 rc = 0;
 	int ret = 0;
 	unsigned int devfn;
-	struct pci_bus *pci_bus = p_slot->ctrl->pci_dev->subordinate;
+	struct pci_bus *pci_bus;
 	struct pci_func *func;
 
 	if (!p_slot->ctrl)
 		return 1;
 
+	pci_bus = p_slot->ctrl->pci_dev->subordinate;
+
 	/* Check to see if (latch closed, card present, power on) */
 	down(&p_slot->ctrl->crit_sect);
 

             reply	other threads:[~2004-09-03 21:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-03 21:10 Dave Jones [this message]
2004-09-08 23:51 ` Use before NULL check in shpchp_ctrl Greg KH

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=20040903211058.GW26419@redhat.com \
    --to=davej@redhat.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /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