From: Johannes Thumshirn <jthumshirn@suse.de>
Date: Thu, 9 Jul 2015 07:39:42 +0000 (+0200)
Subject: cxl: Destroy afu->contexts_idr on release of an afu
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bd664f892e3e2b01c79197cad3111d54b7aedf39;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git

cxl: Destroy afu->contexts_idr on release of an afu

Destroy afu->contexts_idr on release of an afu, reclaiming the allocated
memory.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---

diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index eb05efb74eed..1d314f1f95fe 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -551,6 +551,7 @@ static void cxl_release_afu(struct device *dev)
 
 	pr_devel("cxl_release_afu\n");
 
+	idr_destroy(&afu->contexts_idr);
 	kfree(afu);
 }