Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1675012 > unrolled thread
| Started by | Vikas Shivappa <vikas.shivappa@linux.intel.com> |
|---|---|
| First post | 2017-06-26 21:00 +0200 |
| Last post | 2017-06-30 21:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 02/21] x86/intel_rdt: Fix memory leak during mount Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
[tip:x86/urgent] x86/intel_rdt: Fix memory leak on mount failure tip-bot for Vikas Shivappa <tipbot@zytor.com> - 2017-06-30 21:30 +0200
| From | Vikas Shivappa <vikas.shivappa@linux.intel.com> |
|---|---|
| Date | 2017-06-26 21:00 +0200 |
| Subject | [PATCH 02/21] x86/intel_rdt: Fix memory leak during mount |
| Message-ID | <tWHoR-5Yd-15@gated-at.bofh.it> |
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@linux.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
[toc] | [next] | [standalone]
| From | tip-bot for Vikas Shivappa <tipbot@zytor.com> |
|---|---|
| Date | 2017-06-30 21:30 +0200 |
| Subject | [tip:x86/urgent] x86/intel_rdt: Fix memory leak on mount failure |
| Message-ID | <tY9M7-13z-33@gated-at.bofh.it> |
| In reply to | #1675012 |
Commit-ID: 79298acc4ba097e9ab78644e3e38902d73547c92
Gitweb: http://git.kernel.org/tip/79298acc4ba097e9ab78644e3e38902d73547c92
Author: Vikas Shivappa <vikas.shivappa@linux.intel.com>
AuthorDate: Mon, 26 Jun 2017 11:55:49 -0700
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 30 Jun 2017 21:20:00 +0200
x86/intel_rdt: Fix memory leak on mount failure
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@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: ravi.v.shankar@intel.com
Cc: tony.luck@intel.com
Cc: fenghua.yu@intel.com
Cc: peterz@infradead.org
Cc: vikas.shivappa@intel.com
Cc: andi.kleen@intel.com
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1498503368-20173-3-git-send-email-vikas.shivappa@linux.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:
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web