[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170703133406.042014912@linuxfoundation.org>
Date: Mon, 3 Jul 2017 15:35:27 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>, ravi.v.shankar@...el.com,
tony.luck@...el.com, fenghua.yu@...el.com, peterz@...radead.org,
vikas.shivappa@...el.com, andi.kleen@...el.com
Subject: [PATCH 4.11 47/84] x86/intel_rdt: Fix memory leak on mount failure
4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vikas Shivappa <vikas.shivappa@...ux.intel.com>
commit 79298acc4ba097e9ab78644e3e38902d73547c92 upstream.
If mount fails, the kn_info directory is not freed causing memory leak.
Add the missing error handling path.
Fixes: 4e978d06dedb ("x86/intel_rdt: Add "info" files to resctrl file system")
Signed-off-by: Vikas Shivappa <vikas.shivappa@...ux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: ravi.v.shankar@...el.com
Cc: tony.luck@...el.com
Cc: fenghua.yu@...el.com
Cc: peterz@...radead.org
Cc: vikas.shivappa@...el.com
Cc: andi.kleen@...el.com
Link: http://lkml.kernel.org/r/1498503368-20173-3-git-send-email-vikas.shivappa@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -767,11 +767,13 @@ static struct dentry *rdt_mount(struct f
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:
Powered by blists - more mailing lists