mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 12:11:26 +00:00
qla2x00t-32gbit: Pointer may be dereferenced
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> [ commit 00eca15319d9 upstream ]
This commit is contained in:
@@ -3000,6 +3000,8 @@ qla24xx_bsg_request(BSG_JOB_TYPE *bsg_job)
|
||||
|
||||
if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
|
||||
rport = fc_bsg_to_rport(bsg_job);
|
||||
if (!rport)
|
||||
return ret;
|
||||
host = rport_to_shost(rport);
|
||||
vha = shost_priv(host);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user