From: Bastien Philbert <bastienphilbert@gmail.com>
To: QLogic-Storage-Upstream@qlogic.com
Cc: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] bnx2fc: Fix locking requirements in bnx2fc_init_tgt
Date: Tue, 5 Apr 2016 10:36:46 -0400 [thread overview]
Message-ID: <1459867006-19605-1-git-send-email-bastienphilbert@gmail.com> (raw)
This fixes the locking around the call to bnx2fc_alloc_id to comply
with the comments about this particular function's definition about
requiring the need to hold the hba mutex before and after calling
it.
Signed-off-by: Bastien Philbert <bastienphilbert@gmail.com>
---
drivers/scsi/bnx2fc/bnx2fc_tgt.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
index 08ec318..f2988cd 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
@@ -368,9 +368,13 @@ static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt,
return -1;
}
+ mutex_lock(&hba->hba_mutex);
tgt->fcoe_conn_id = bnx2fc_alloc_conn_id(hba, tgt);
- if (tgt->fcoe_conn_id == -1)
+ if (tgt->fcoe_conn_id == -1) {
+ mutex_unlock(&hba->hba_mutex);
return -1;
+ }
+ mutex_unlock(&hba->hba_mutex);
BNX2FC_TGT_DBG(tgt, "init_tgt - conn_id = 0x%x\n", tgt->fcoe_conn_id);
--
2.5.0
next reply other threads:[~2016-04-05 14:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 14:36 Bastien Philbert [this message]
2016-04-05 17:43 ` [PATCH] bnx2fc: Fix locking requirements in bnx2fc_init_tgt Chad Dupuis
2016-04-05 17:43 ` Chad Dupuis
2016-04-05 17:50 ` Bastien Bastien Philbert
2016-04-06 1:16 ` James Bottomley
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=1459867006-19605-1-git-send-email-bastienphilbert@gmail.com \
--to=bastienphilbert@gmail.com \
--cc=QLogic-Storage-Upstream@qlogic.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.