public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: hpt366 ptr use before NULL check.
Date: Fri, 3 Sep 2004 22:15:47 +0100	[thread overview]
Message-ID: <20040903211546.GY26419@redhat.com> (raw)

Another picked up with the coverity checker.

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

--- linux-2.6.8/drivers/ide/pci/hpt366.c~	2004-09-03 22:13:46.870500672 +0100
+++ linux-2.6.8/drivers/ide/pci/hpt366.c	2004-09-03 22:14:53.095432952 +0100
@@ -773,13 +773,17 @@
 static int hpt3xx_tristate (ide_drive_t * drive, int state)
 {
 	ide_hwif_t *hwif	= HWIF(drive);
-	struct pci_dev *dev	= hwif->pci_dev;
-	u8 reg59h = 0, reset	= (hwif->channel) ? 0x80 : 0x40;
-	u8 regXXh = 0, state_reg= (hwif->channel) ? 0x57 : 0x53;
+	struct pci_dev *dev;
+	u8 reg59h = 0, reset;
+	u8 regXXh = 0, state_reg;
 
 	if (!hwif)
 		return -EINVAL;
 
+	dev = hwif->pci_dev;
+	reset = (hwif->channel) ? 0x80 : 0x40;
+	state_reg = (hwif->channel) ? 0x57 : 0x53;
+
 //	hwif->bus_state = state;
 
 	pci_read_config_byte(dev, 0x59, &reg59h);

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-03 21:15 Dave Jones [this message]
2004-09-03 21:53 ` hpt366 ptr use before NULL check Dave Jones
2004-09-03 22:17   ` Bartlomiej Zolnierkiewicz
2004-09-03 22:28     ` Dave Jones

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=20040903211546.GY26419@redhat.com \
    --to=davej@redhat.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --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