From: <anil.gurumurthy@qlogic.com>
To: James.Bottomley@HansenPartnership.com, hch@infradead.org
Cc: linux-scsi@vger.kernel.org, Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Subject: [PATCH RESEND 2/4] bfa:Fix for crash when bfa_itnim is NULL
Date: Tue, 3 Feb 2015 03:45:01 -0500 [thread overview]
Message-ID: <1422953103-5470-3-git-send-email-anil.gurumurthy@qlogic.com> (raw)
In-Reply-To: <1422953103-5470-1-git-send-email-anil.gurumurthy@qlogic.com>
From: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
---
drivers/scsi/bfa/bfad_im.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 575efdc..3e4dce7 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -272,6 +272,19 @@ bfad_im_target_reset_send(struct bfad_s *bfad, struct scsi_cmnd *cmnd,
cmnd->host_scribble = NULL;
cmnd->SCp.Status = 0;
bfa_itnim = bfa_fcs_itnim_get_halitn(&itnim->fcs_itnim);
+ /*
+ * bfa_itnim can be NULL if the port gets disconnected and the bfa
+ * and fcs layers have cleaned up their nexus with the targets and
+ * the same has not been cleaned up by the shim
+ */
+ if (bfa_itnim == NULL) {
+ bfa_tskim_free(tskim);
+ BFA_LOG(KERN_ERR, bfad, bfa_log_level,
+ "target reset, bfa_itnim is NULL\n");
+ rc = BFA_STATUS_FAILED;
+ goto out;
+ }
+
memset(&scsilun, 0, sizeof(scsilun));
bfa_tskim_start(tskim, bfa_itnim, scsilun,
FCP_TM_TARGET_RESET, BFAD_TARGET_RESET_TMO);
@@ -327,6 +340,19 @@ bfad_im_reset_lun_handler(struct scsi_cmnd *cmnd)
cmnd->SCp.ptr = (char *)&wq;
cmnd->SCp.Status = 0;
bfa_itnim = bfa_fcs_itnim_get_halitn(&itnim->fcs_itnim);
+ /*
+ * bfa_itnim can be NULL if the port gets disconnected and the bfa
+ * and fcs layers have cleaned up their nexus with the targets and
+ * the same has not been cleaned up by the shim
+ */
+ if (bfa_itnim == NULL) {
+ bfa_tskim_free(tskim);
+ BFA_LOG(KERN_ERR, bfad, bfa_log_level,
+ "lun reset, bfa_itnim is NULL\n");
+ spin_unlock_irqrestore(&bfad->bfad_lock, flags);
+ rc = FAILED;
+ goto out;
+ }
int_to_scsilun(cmnd->device->lun, &scsilun);
bfa_tskim_start(tskim, bfa_itnim, scsilun,
FCP_TM_LUN_RESET, BFAD_LUN_RESET_TMO);
--
1.7.1
next prev parent reply other threads:[~2015-02-03 9:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 8:44 [PATCH RESEND 0/4] bfa: Patches for scsi "misc" branch anil.gurumurthy
2015-02-03 8:45 ` [PATCH RESEND 1/4] bfa:Updating copyright messages anil.gurumurthy
2015-02-03 8:45 ` anil.gurumurthy [this message]
2015-04-28 14:28 ` [PATCH RESEND 2/4] bfa:Fix for crash when bfa_itnim is NULL Tomas Henzl
2015-02-03 8:45 ` [PATCH RESEND 3/4] bfa:File header and user visible string changes anil.gurumurthy
2015-04-28 14:32 ` Tomas Henzl
2015-02-03 8:45 ` [PATCH RESEND 4/4] bfa:Update driver version to 3.2.25.0 anil.gurumurthy
2015-04-28 14:29 ` Tomas Henzl
2015-04-24 5:46 ` [PATCH RESEND 0/4] bfa: Patches for scsi "misc" branch Anil Gurumurthy
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=1422953103-5470-3-git-send-email-anil.gurumurthy@qlogic.com \
--to=anil.gurumurthy@qlogic.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=hch@infradead.org \
--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;
as well as URLs for NNTP newsgroup(s).