scsi: bnx2fc: fix bnx2fc_cmd refcount imbalance in send_rec
authorLin Yi <teroincn@163.com>
Tue, 25 Jun 2019 02:34:16 +0000 (10:34 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 27 Jun 2019 02:43:02 +0000 (22:43 -0400)
commit177709c0702e7351dae3b9b4f9de3140a9ee3a06
tree0c3198064d719f79b3698766111214cf71cb52f0
parent10b3ef2270189fee35ca21b70463481353f1e160
scsi: bnx2fc: fix bnx2fc_cmd refcount imbalance in send_rec

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 rec_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>
drivers/scsi/bnx2fc/bnx2fc_els.c