scsi: qla2xxx: Fix double free of the ha->vp_map pointer
authorSaurav Kashyap <skashyap@marvell.com>
Tue, 27 Feb 2024 16:41:23 +0000 (22:11 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 10 Mar 2024 22:44:43 +0000 (18:44 -0400)
commite288285d47784fdcf7c81be56df7d65c6f10c58b
treec0a6d6bd3391d0b7d635b7fc65edc9d62457548f
parenta27d4d0e7de305def8a5098a614053be208d1aa1
scsi: qla2xxx: Fix double free of the ha->vp_map pointer

Coverity scan reported potential risk of double free of the pointer
ha->vp_map.  ha->vp_map was freed in qla2x00_mem_alloc(), and again freed
in function qla2x00_mem_free(ha).

Assign NULL to vp_map and kfree take care of NULL.

Cc: stable@vger.kernel.org
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20240227164127.36465-8-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_os.c