summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2017-03-23 20:41:26 -0700
committerJens Axboe <axboe@fb.com>2017-04-04 09:48:23 -0600
commitc820ad4cdacbb272ec993738d1c7eb96f09ddcd5 (patch)
tree6b93bd11c0af36fab0ea336b42d558e9437cb9fc /drivers
parentf77fc87c3716f59be0248bf430fbf9d7888902b1 (diff)
nvmet_fc: Clear SG list to avoid double frees
Clear SG list to avoid double frees of payload page list Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/target/fc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 3a0f22e506ad..2c0709f0a7d3 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -1624,6 +1624,8 @@ nvmet_fc_free_tgt_pgs(struct nvmet_fc_fcp_iod *fod)
for_each_sg(fod->data_sg, sg, fod->data_sg_cnt, count)
__free_page(sg_page(sg));
kfree(fod->data_sg);
+ fod->data_sg = NULL;
+ fod->data_sg_cnt = 0;
}