Skip to content
/ linux Public

Commit 25d623f

Browse files
ColinIanKingSasha Levin
authored andcommitted
scsi: csiostor: Fix dereference of null pointer rn
[ Upstream commit 1982257 ] The error exit path when rn is NULL ends up deferencing the null pointer rn via the use of the macro CSIO_INC_STATS. Fix this by adding a new error return path label after the use of the macro to avoid the deference. Fixes: a3667aa ("[SCSI] csiostor: Chelsio FCoE offload driver") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://patch.msgid.link/20260129155332.196338-1-colin.i.king@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 94a6c85 commit 25d623f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/scsi/csiostor/csio_scsi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd)
20742074
struct csio_scsi_level_data sld;
20752075

20762076
if (!rn)
2077-
goto fail;
2077+
goto fail_ret;
20782078

20792079
csio_dbg(hw, "Request to reset LUN:%llu (ssni:0x%x tgtid:%d)\n",
20802080
cmnd->device->lun, rn->flowid, rn->scsi_id);
@@ -2220,6 +2220,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd)
22202220
csio_put_scsi_ioreq_lock(hw, scsim, ioreq);
22212221
fail:
22222222
CSIO_INC_STATS(rn, n_lun_rst_fail);
2223+
fail_ret:
22232224
return FAILED;
22242225
}
22252226

0 commit comments

Comments
 (0)