public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Jayamohan Kallickal <jayamohank@serverengines.com>
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>,
	Mike Christie <michaelc@cs.wisc.edu>,
	linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch 2/2] be2iscsi: null dereference on error path
Date: Thu, 10 Jun 2010 09:53:05 +0200	[thread overview]
Message-ID: <20100610075305.GJ5483@bicker> (raw)

"phba" is always null here so we can't dereference it.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 779e1d1..efadde9 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -3774,8 +3774,8 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
 
 	ret = beiscsi_enable_pci(pcidev);
 	if (ret < 0) {
-		shost_printk(KERN_ERR, phba->shost, "beiscsi_dev_probe-"
-			     "Failed to enable pci device \n");
+		dev_err(&pcidev->dev, "beiscsi_dev_probe-"
+			" Failed to enable pci device\n");
 		return ret;
 	}
 

             reply	other threads:[~2010-06-10  7:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10  7:53 Dan Carpenter [this message]
2010-06-10 20:43 ` [patch 2/2] be2iscsi: null dereference on error path Mike Christie

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=20100610075305.GJ5483@bicker \
    --to=error27@gmail.com \
    --cc=James.Bottomley@suse.de \
    --cc=jayamohank@serverengines.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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