From: Arnd Bergmann <arnd@arndb.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>, Fenghua Yu <fenghua.yu@intel.com>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] x86/intel_rdt: fix rdt_mount error handling
Date: Tue, 8 Nov 2016 14:42:03 +0100 [thread overview]
Message-ID: <20161108134233.1803001-1-arnd@arndb.de> (raw)
The newly introduced rdt_mount function returns an unintialized
pointer if rdtgroup_create_info_dir() fails:
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c: In function ‘rdt_mount’:
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:710:9: error: ‘dentry’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
Clearly the intention was to propagate the error code here as we
do in the other failure cases.
Fixes: 5ff193fbde20 ("x86/intel_rdt: Add basic resctrl filesystem support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
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 a90ad22b9823..e66c7a58505e 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -691,8 +691,10 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type,
closid_init();
ret = rdtgroup_create_info_dir(rdtgroup_default.kn);
- if (ret)
+ if (ret) {
+ dentry = ERR_PTR(ret);
goto out_cdp;
+ }
dentry = kernfs_mount(fs_type, flags, rdt_root,
RDTGROUP_SUPER_MAGIC, NULL);
--
2.9.0
next reply other threads:[~2016-11-08 13:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 13:42 Arnd Bergmann [this message]
2016-11-08 14:46 ` [PATCH] x86/intel_rdt: fix rdt_mount error handling Thomas Gleixner
2016-11-08 17:23 ` Yu, Fenghua
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161108134233.1803001-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).