From: Dan Carpenter <error27@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: james.smart@emulex.com, James.Bottomley@suse.de
Subject: [patch] potential null deref in lpfc_els.c
Date: Sat, 5 Dec 2009 14:35:19 +0200 [thread overview]
Message-ID: <20091205123519.GF5224@bicker> (raw)
This patch is against 2.6.32-rc8.
The issue was found by a static checker. If cmd == ELS_CMD_PLOGI, it
is possible for ndlp to be NULL. We do check ndlp further down the
function so that would also indicate that we should check ndlp here.
Compile tested.
Signed-off-by: Dan Carpenter <error27@gmail.com>
--- orig/drivers/scsi/lpfc/lpfc_els.c 2009-12-05 10:52:02.000000000 +0200
+++ devel/drivers/scsi/lpfc/lpfc_els.c 2009-12-05 11:43:49.000000000 +0200
@@ -2548,7 +2548,7 @@ lpfc_els_retry(struct lpfc_hba *phba, st
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD,
"Retry ELS: wd7:x%x wd4:x%x did:x%x",
- *(((uint32_t *) irsp) + 7), irsp->un.ulpWord[4], ndlp->nlp_DID);
+ *(((uint32_t *) irsp) + 7), irsp->un.ulpWord[4], (ndlp ? ndlp->nlp_DID : 0));
switch (irsp->ulpStatus) {
case IOSTAT_FCP_RSP_ERROR:
next reply other threads:[~2009-12-05 12:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-05 12:35 Dan Carpenter [this message]
[not found] <1260295121.6096.19.camel@wookie>
2009-12-08 18:01 ` [patch] potential null deref in lpfc_els.c James Smart
2009-12-09 10:52 ` Dan Carpenter
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=20091205123519.GF5224@bicker \
--to=error27@gmail.com \
--cc=James.Bottomley@suse.de \
--cc=james.smart@emulex.com \
--cc=linux-scsi@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