scsi: iscsi: qla4xxx: fix double free in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 3 Dec 2019 09:45:09 +0000 (12:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2020 09:17:51 +0000 (10:17 +0100)
commit5fac6ee295213de276fb0da852d773af43c24d46
tree20bd35bb6ce3be0f4493646ab82132407cd4706c
parent28725bba2be905b00fce2533ac6f48a9f8426df7
scsi: iscsi: qla4xxx: fix double free in probe

[ Upstream commit fee92f25777789d73e1936b91472e9c4644457c8 ]

On this error path we call qla4xxx_mem_free() and then the caller also
calls qla4xxx_free_adapter() which calls qla4xxx_mem_free().  It leads to a
couple double frees:

drivers/scsi/qla4xxx/ql4_os.c:8856 qla4xxx_probe_adapter() warn: 'ha->chap_dma_pool' double freed
drivers/scsi/qla4xxx/ql4_os.c:8856 qla4xxx_probe_adapter() warn: 'ha->fw_ddb_dma_pool' double freed

Fixes: afaf5a2d341d ("[SCSI] Initial Commit of qla4xxx")
Link: https://lore.kernel.org/r/20191203094421.hw7ex7qr3j2rbsmx@kili.mountain
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/qla4xxx/ql4_os.c