]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
scsi: qla2xxx: Avoid fcport pointer dereference
authorNilesh Javali <njavali@marvell.com>
Wed, 7 Jun 2023 11:38:38 +0000 (17:08 +0530)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:20:24 +0000 (17:20 +0200)
commita252c19b8d46d575a35e6d995f8c46d74f7eede2
treee5071465408dbf849f25789e69c530e904eea27a
parent08702f9c643df076237a6bff63b797a6e89f7a7a
scsi: qla2xxx: Avoid fcport pointer dereference

BugLink: https://bugs.launchpad.net/bugs/2036075
commit 6b504d06976fe4a61cc05dedc68b84fadb397f77 upstream.

Klocwork reported warning of NULL pointer may be dereferenced.  The routine
exits when sa_ctl is NULL and fcport is allocated after the exit call thus
causing NULL fcport pointer to dereference at the time of exit.

To avoid fcport pointer dereference, exit the routine when sa_ctl is NULL.

Cc: stable@vger.kernel.org
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20230607113843.37185-4-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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/scsi/qla2xxx/qla_edif.c