Re: [EXT] [PATCH v2 2/2] scsi :bnx2fc :bnx2fc_els :fix bnx2fc_cmd refcount imbalance in send_srr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lin,

On 25/06/19, 8:05 AM, "Lin Yi" <teroincn@xxxxxxx> wrote:

>External Email
>
>----------------------------------------------------------------------
>if cb_arg alloc failed, we can't release the struct orig_io_req refcount
>before we take it's refcount. As Saurav said, move the srr_err label
>down to avoid unnecessary refcount release and nullptr free.
>
>Signed-off-by: Lin Yi <teroincn@xxxxxxx>
>---
>Changes in v2:
> -move the srr_err label down instead of moving kref_get.
>---
> drivers/scsi/bnx2fc/bnx2fc_els.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c
>b/drivers/scsi/bnx2fc/bnx2fc_els.c
>index e33b94f..b807736 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 @@ int bnx2fc_send_srr(struct bnx2fc_cmd *orig_io_req,
>u32 offset, u8 r_ctl)
> 	} else
> 		set_bit(BNX2FC_FLAG_SRR_SENT, &orig_io_req->req_flags);
> 
>+srr_err:
> 	return rc;
> }
> 
>-- 
>1.9.1

Thanks for the patch.

Asked-by: Saurav Kashyap <skashyap@xxxxxxxxxxx>
>
>





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux