summaryrefslogtreecommitdiff
path: root/drivers/scsi/bnx2fc
diff options
context:
space:
mode:
authorLin Yi <teroincn@163.com>2019-06-25 05:35:29 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2019-06-27 05:43:02 +0300
commit7bfe5ae57c803dd529aaf6feb32c3b49ebff66bd (patch)
tree0e9c5594911a642dc4a3c3bb149638b4208e548d /drivers/scsi/bnx2fc
parent177709c0702e7351dae3b9b4f9de3140a9ee3a06 (diff)
downloadlinux-7bfe5ae57c803dd529aaf6feb32c3b49ebff66bd.tar.xz
scsi: bnx2fc: fix bnx2fc_cmd refcount imbalance in send_srr
If cb_arg alloc failed, we can't release the struct orig_io_req refcount before we take its refcount. As Saurav said, move the srr_err label down to avoid unnecessary refcount release and nullptr free. Signed-off-by: Lin Yi <teroincn@163.com> Acked-by: Saurav Kashyap <skashyap@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/bnx2fc')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_els.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi/bnx2fc/bnx2fc_els.c
index 9a8e40bc694b..754f2e82d955 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_els.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_els.c
@@ -654,7 +654,6 @@ int bnx2fc_send_srr(struct bnx2fc_cmd *orig_io_req, u32 offset, u8 r_ctl)
rc = bnx2fc_initiate_els(tgt, ELS_SRR, &srr, sizeof(srr),
bnx2fc_srr_compl, cb_arg,
r_a_tov);
-srr_err:
if (rc) {
BNX2FC_IO_DBG(orig_io_req, "SRR failed - release\n");
spin_lock_bh(&tgt->tgt_lock);
@@ -664,6 +663,7 @@ srr_err:
} else
set_bit(BNX2FC_FLAG_SRR_SENT, &orig_io_req->req_flags);
+srr_err:
return rc;
}