From: "Jörn Engel" <joern@logfs.org>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: target-devel@vger.kernel.org, linux-driver@qlogic.com,
linux-scsi@vger.kernel.org,
Roland Dreier <roland@purestorage.com>
Subject: [PATCH] qla2xxx: Fix NULL pointer dereference
Date: Fri, 17 Feb 2012 15:39:39 -0500 [thread overview]
Message-ID: <20120217203939.GA955@logfs.org> (raw)
Afaics the assignment does not need to be protected by ha->tgt_mutex and
we definitely should check for NULL before dereferencing sess.
Signed-off-by: Joern Engel <joern@logfs.org>
---
drivers/scsi/qla2xxx/qla_target.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index ac203ef..4bbfa88 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -2586,12 +2586,12 @@ static void qla_tgt_do_work(struct work_struct *work)
mutex_lock(&ha->tgt_mutex);
cmd->sess = sess = qla_tgt_make_local_sess(vha, s_id, loop_id);
- cmd->loop_id = sess->loop_id;
/* sess has got an extra creation ref */
mutex_unlock(&ha->tgt_mutex);
if (!sess)
goto out_term;
+ cmd->loop_id = sess->loop_id;
}
if (tgt->tgt_stop)
--
1.7.8.3
next reply other threads:[~2012-02-17 20:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-17 20:39 Jörn Engel [this message]
2012-02-18 1:36 ` [PATCH] qla2xxx: Fix NULL pointer dereference Roland Dreier
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=20120217203939.GA955@logfs.org \
--to=joern@logfs.org \
--cc=andrew.vasquez@qlogic.com \
--cc=linux-driver@qlogic.com \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=roland@purestorage.com \
--cc=target-devel@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