Skip to content

Commit e288285

Browse files
Saurav Kashyapmartinkpetersen
authored andcommitted
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: [email protected] Signed-off-by: Saurav Kashyap <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent a27d4d0 commit e288285

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4602,6 +4602,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
46024602
ha->init_cb_dma = 0;
46034603
fail_free_vp_map:
46044604
kfree(ha->vp_map);
4605+
ha->vp_map = NULL;
46054606
fail:
46064607
ql_log(ql_log_fatal, NULL, 0x0030,
46074608
"Memory allocation failure.\n");

0 commit comments

Comments
 (0)