[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1498503368-20173-3-git-send-email-vikas.shivappa@linux.intel.com>
Date: Mon, 26 Jun 2017 11:55:49 -0700
From: Vikas Shivappa <vikas.shivappa@...ux.intel.com>
To: x86@...nel.org, linux-kernel@...r.kernel.org, tglx@...utronix.de
Cc: hpa@...or.com, peterz@...radead.org, ravi.v.shankar@...el.com,
vikas.shivappa@...el.com, tony.luck@...el.com,
fenghua.yu@...el.com, andi.kleen@...el.com
Subject: [PATCH 02/21] x86/intel_rdt: Fix memory leak during mount
If mount fails, the kn_info directory is not freed causing memory leak.
Fix the leak by freeing kn_info when mount fails.
Signed-off-by: Vikas Shivappa <vikas.shivappa@...ux.intel.com>
---
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index f5af0cc..9257bd9 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -856,11 +856,13 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type,
dentry = kernfs_mount(fs_type, flags, rdt_root,
RDTGROUP_SUPER_MAGIC, NULL);
if (IS_ERR(dentry))
- goto out_cdp;
+ goto out_destroy;
static_branch_enable(&rdt_enable_key);
goto out;
+out_destroy:
+ kernfs_remove(kn_info);
out_cdp:
cdp_disable();
out:
--
1.9.1
Powered by blists - more mailing lists