From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbdF3T0H (ORCPT ); Fri, 30 Jun 2017 15:26:07 -0400 Received: from terminus.zytor.com ([65.50.211.136]:36789 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752162AbdF3T0F (ORCPT ); Fri, 30 Jun 2017 15:26:05 -0400 Date: Fri, 30 Jun 2017 12:24:46 -0700 From: tip-bot for Vikas Shivappa Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, vikas.shivappa@linux.intel.com, mingo@kernel.org, tglx@linutronix.de Reply-To: mingo@kernel.org, linux-kernel@vger.kernel.org, vikas.shivappa@linux.intel.com, hpa@zytor.com, tglx@linutronix.de In-Reply-To: <1498503368-20173-3-git-send-email-vikas.shivappa@linux.intel.com> References: <1498503368-20173-3-git-send-email-vikas.shivappa@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/intel_rdt: Fix memory leak on mount failure Git-Commit-ID: 79298acc4ba097e9ab78644e3e38902d73547c92 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 79298acc4ba097e9ab78644e3e38902d73547c92 Gitweb: http://git.kernel.org/tip/79298acc4ba097e9ab78644e3e38902d73547c92 Author: Vikas Shivappa AuthorDate: Mon, 26 Jun 2017 11:55:49 -0700 Committer: Thomas Gleixner 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 Signed-off-by: Thomas Gleixner 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: