public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SCSI: qla4xxx: fix double free bug
@ 2019-11-05  9:25 Pan Bian
  2019-11-14  4:42 ` Manish Rangankar
  2019-11-19  4:30 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Pan Bian @ 2019-11-05  9:25 UTC (permalink / raw)
  To: QLogic-Storage-Upstream, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, Pan Bian

The variable init_fw_cb is released twice, resulting in a double free
bug. The call to the function dma_free_coherent() before goto is removed
to get rid of potential double free.

Fixes: 2a49a78ed3c ("[SCSI] qla4xxx: added IPv6 support.")
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/scsi/qla4xxx/ql4_mbx.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index dac9a7013208..02636b4785c5 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -640,9 +640,6 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)
 
 	if (qla4xxx_get_ifcb(ha, &mbox_cmd[0], &mbox_sts[0], init_fw_cb_dma) !=
 	    QLA_SUCCESS) {
-		dma_free_coherent(&ha->pdev->dev,
-				  sizeof(struct addr_ctrl_blk),
-				  init_fw_cb, init_fw_cb_dma);
 		goto exit_init_fw_cb;
 	}
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-19  4:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-05  9:25 [PATCH] SCSI: qla4xxx: fix double free bug Pan Bian
2019-11-14  4:42 ` Manish Rangankar
2019-11-19  4:30 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox