This fix will not work, as daxctl_ctx is freed before free_dax() and daxctl_region_unref()
tries to update daxctl_ctx.
-----Original Message-----
From: Linux-nvdimm [mailto:linux-nvdimm-bounces@lists.01.org] On Behalf
Of Dan Williams
Sent: Friday, February 2, 2018 09:29
To: linux-nvdimm(a)lists.01.org
Subject: [ndctl PATCH] ndctl: fix leak of daxctl_region instances
The daxctl_region returned by ndctl_dax_get_daxctl_region() should be
automatically freed when its parent infrastructure is torn down.
Reported-by: Lukasz Plewa <lukasz.plewa(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
ndctl/lib/libndctl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c index
4119a2e6b564..9314e8b8f81b 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -434,6 +434,7 @@ static void free_pfn(struct ndctl_pfn *pfn, struct
list_head *head)
static void free_dax(struct ndctl_dax *dax, struct list_head *head) {
+ daxctl_region_unref(dax->region);
__free_pfn(&dax->pfn, head, dax);
}
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm(a)lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm