]> git.ipfire.org Git - thirdparty/kernel/stable.git/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:29:02 +0000 (15:29 +0200)
commitf14cee7a882cb79528f17a2335f53e9fd1848467
tree77f168f20175460ca5e655c4aa863b139529e8a9
parent8de1584ec4fe0ebea33c273036e7e0a05e65c81d
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