Skip to contentSkip to conversation

nvmet_fc: Clear SG list to avoid double frees

PATCH New James Smart 2 participants 2 messages Dec 24, 2016 – Jan 9, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 at broadcom.com>
---
 drivers/nvme/target/fc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/target/fc.c +2 -0
index ce1f08d..fe74fc6 100644
@@ -1616,6 +1616,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;
 }
 
 
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/1 nvmet_fc: Clear SG list to avoid double frees

Quoted 5 lines · James Smart

Clear SG list to avoid double frees of payload page list

Signed-off-by James Smart <james.smart at broadcom.com>

---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850