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.pl...@intel.com>
Signed-off-by: Dan Williams <dan.j.willi...@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@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to