Skip to content

Commit 22b1d7c

Browse files
Shreyas Deodhargregkh
Shreyas Deodhar
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 824ff8d commit 22b1d7c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/scsi/qla2xxx/qla_bsg.c

+2
Original file line numberDiff line numberDiff line change
@@ -2996,6 +2996,8 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
29962996

29972997
if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
29982998
rport = fc_bsg_to_rport(bsg_job);
2999+
if (!rport)
3000+
return ret;
29993001
host = rport_to_shost(rport);
30003002
vha = shost_priv(host);
30013003
} else {

0 commit comments

Comments
 (0)