This is a note to let you know that I've just added the patch titled scsi: qla2xxx: Pointer may be dereferenced to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: scsi-qla2xxx-pointer-may-be-dereferenced.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 00eca15319d9ce8c31cdf22f32a3467775423df4 Mon Sep 17 00:00:00 2001 From: Shreyas Deodhar <sdeodhar@xxxxxxxxxxx> Date: Wed, 7 Jun 2023 17:08:41 +0530 Subject: scsi: qla2xxx: Pointer may be dereferenced From: Shreyas Deodhar <sdeodhar@xxxxxxxxxxx> commit 00eca15319d9ce8c31cdf22f32a3467775423df4 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@xxxxxxxxxxxxxxx Signed-off-by: Shreyas Deodhar <sdeodhar@xxxxxxxxxxx> Signed-off-by: Nilesh Javali <njavali@xxxxxxxxxxx> Link: https://lore.kernel.org/r/20230607113843.37185-7-njavali@xxxxxxxxxxx Reviewed-by: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/scsi/qla2xxx/qla_bsg.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -2903,6 +2903,8 @@ qla24xx_bsg_request(struct bsg_job *bsg_ 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 { Patches currently in stable-queue which might be from sdeodhar@xxxxxxxxxxx are queue-5.15/scsi-qla2xxx-pointer-may-be-dereferenced.patch