diff mbox series

scsi: fix the problem that the pointer "sp" is double free

Message ID 20211116024558.7647-1-zhangyue1@kylinos.cn
State New
Headers show
Series scsi: fix the problem that the pointer "sp" is double free | expand

Commit Message

zhangyue Nov. 16, 2021, 2:45 a.m. UTC
in function qla24xx_sp_unmap, it is already called sp->free(sp), then
it`s not need to called sp->free(sp) after qla24xx_sp_unmap is called.

Signed-off-by: zhangyue <zhangyue1@kylinos.cn>
---
 drivers/scsi/qla2xxx/qla_gs.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index c3195d4c25e5..a7198a1e23fb 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -4228,7 +4228,6 @@  static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res)
 		if (rc) {
 			/* Cleanup here to prevent memory leak */
 			qla24xx_sp_unmap(vha, sp);
-			sp->free(sp);
 		}
 
 		spin_lock_irqsave(&vha->work_lock, flags);