From b4a3564f34ca075a702456de09f3b7ed562a97a2 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 1 May 2019 22:40:15 +0000 Subject: [PATCH] qla2xxx-32gbit: Avoid that qla2x00_mem_free() crashes if called twice Clear each pointer after having freed memory such that it becomes safe to call qla2x00_mem_free() twice. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8295 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_os.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index a844589f3..4cffb0946 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -4795,6 +4795,8 @@ qla2x00_mem_free(struct qla_hw_data *ha) if (ha->flt) dma_free_coherent(&ha->pdev->dev, SFP_DEV_SIZE, ha->flt, ha->flt_dma); + ha->flt = NULL; + ha->flt_dma = 0; if (ha->ms_iocb) dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma); @@ -4870,6 +4872,7 @@ qla2x00_mem_free(struct qla_hw_data *ha) if (ha->dif_bundl_pool) dma_pool_destroy(ha->dif_bundl_pool); + ha->dif_bundl_pool = NULL; qlt_mem_free(ha);