Patch "x86/intel_rdt: Fix memory leak on mount failure" has been added to the 4.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86/intel_rdt: Fix memory leak on mount failure

to the 4.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-intel_rdt-fix-memory-leak-on-mount-failure.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 79298acc4ba097e9ab78644e3e38902d73547c92 Mon Sep 17 00:00:00 2001
From: Vikas Shivappa <vikas.shivappa@xxxxxxxxxxxxxxx>
Date: Mon, 26 Jun 2017 11:55:49 -0700
Subject: x86/intel_rdt: Fix memory leak on mount failure

From: Vikas Shivappa <vikas.shivappa@xxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: ravi.v.shankar@xxxxxxxxx
Cc: tony.luck@xxxxxxxxx
Cc: fenghua.yu@xxxxxxxxx
Cc: peterz@xxxxxxxxxxxxx
Cc: vikas.shivappa@xxxxxxxxx
Cc: andi.kleen@xxxxxxxxx
Link: http://lkml.kernel.org/r/1498503368-20173-3-git-send-email-vikas.shivappa@xxxxxxxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 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:


Patches currently in stable-queue which might be from vikas.shivappa@xxxxxxxxxxxxxxx are

queue-4.11/x86-intel_rdt-fix-memory-leak-on-mount-failure.patch



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]