diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-04-18 00:44:22 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-04-30 00:24:49 +0300 |
commit | 5365bf99e360bf3c31f2d5ba8f20f60dd47f6a86 (patch) | |
tree | 5c6ced733a4ac3f35d3a3a634e1f4742a78ca70f /drivers/scsi/qla2xxx/qla_target.c | |
parent | 0a59cea487e4d3c04364f29df241c9f7001ac6ff (diff) | |
download | linux-5365bf99e360bf3c31f2d5ba8f20f60dd47f6a86.tar.xz |
scsi: qla2xxx: Make qla2x00_mem_free() easier to verify
Instead of clearing all freed pointers at the end of qla2x00_mem_free(),
clear freed pointers immediately after having freed the memory these
pointers point at.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_target.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index bb16280a8d72..bf5b800e5326 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -7347,7 +7347,10 @@ qlt_mem_free(struct qla_hw_data *ha) sizeof(struct atio_from_isp), ha->tgt.atio_ring, ha->tgt.atio_dma); } + ha->tgt.atio_ring = NULL; + ha->tgt.atio_dma = 0; kfree(ha->tgt.tgt_vp_map); + ha->tgt.tgt_vp_map = NULL; } /* vport_slock to be held by the caller */ |