Skip to content

Commit 05ee376

Browse files
Shreyas DeodharFishwaldo
authored andcommitted
scsi: qla2xxx: Pointer may be dereferenced
commit 00eca15 upstream. Klocwork tool reported pointer 'rport' returned from call to function fc_bsg_to_rport() may be NULL and will be dereferenced. Add a fix to validate rport before dereferencing. Cc: stable@vger.kernel.org Signed-off-by: Shreyas Deodhar <sdeodhar@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Link: https://lore.kernel.org/r/20230607113843.37185-7-njavali@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 23efa9f commit 05ee376

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/scsi/qla2xxx/qla_bsg.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,6 +2903,8 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
29032903

29042904
if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
29052905
rport = fc_bsg_to_rport(bsg_job);
2906+
if (!rport)
2907+
return ret;
29062908
host = rport_to_shost(rport);
29072909
vha = shost_priv(host);
29082910
} else {

0 commit comments

Comments
 (0)