]> git.hungrycats.org Git - linux/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:57 +0000 (15:11 +0200)
commitb7deb675d674f44e0ddbab87fee8f9f098925e73
tree3db3339b2264e767b362b24a126fb4d09a5a36ea
parent8f0d32004e3a572bb77e6c11c2797c87f8c9703d
scsi: qla2xxx: Fix double free of the ha->vp_map pointer

commit e288285d47784fdcf7c81be56df7d65c6f10c58b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/qla2xxx/qla_os.c