From: James Smart Date: Fri, 24 Mar 2017 03:41:26 +0000 (-0700) Subject: nvmet_fc: Clear SG list to avoid double frees X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=c820ad4cdacbb272ec993738d1c7eb96f09ddcd5;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Sagi Grimberg Signed-off-by: Jens Axboe --- 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; }