Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1587693
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] scsi: lpfc: fix missing spin_unlock on sql_list_lock |
| Date | 2017-02-24 15:40 +0100 |
| Message-ID | <tepcl-1uK-11@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
From: Colin Ian King <colin.king@canonical.com>
In the case where sglq is null, the current code just returns without
unlocking the spinlock sql_list_lock. Fix this by breaking out of the
while loop and the exit path will then unlock and return NULL as was
the original intention.
Detected by CoverityScan, CID#1411635 ("Missing unlock")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/scsi/lpfc/lpfc_sli.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 1fba5dc..40720bb 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -952,7 +952,7 @@ __lpfc_sli_get_els_sglq(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq)
start_sglq = sglq;
while (!found) {
if (!sglq)
- return NULL;
+ break;
if (ndlp && ndlp->active_rrqs_xri_bitmap &&
test_bit(sglq->sli4_lxritag,
ndlp->active_rrqs_xri_bitmap)) {
--
2.10.2
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] scsi: lpfc: fix missing spin_unlock on sql_list_lock Colin King <colin.king@canonical.com> - 2017-02-24 15:40 +0100
csiph-web