[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161025212310.2346367-1-arnd@arndb.de>
Date: Tue, 25 Oct 2016 23:22:30 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Oleg Drokin <oleg.drokin@...el.com>,
Patrick Farrell <paf@...y.com>, lustre-devel@...ts.lustre.org,
Bobi Jam <bobijam@...mail.com>,
James Simmons <uja.ornl@...oo.com>, Olaf Weber <olaf@....com>,
James Simmons <jsimmons@...radead.org>,
Jinshan Xiong <jinshan.xiong@...el.com>,
"John L . Hammond" <john.hammond@...el.com>,
Liang Zhen <liang.zhen@...el.com>,
Arnd Bergmann <arnd@...db.de>,
Andreas Dilger <andreas.dilger@...el.com>,
Shivani Bhardwaj <shivanib134@...il.com>,
Andriy Skulysh <Andriy_Skulysh@...atex.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/2] staging: lustre: remove broken dead code in cfs_cpt_table_create_pattern
After a recent bugfix, we get a warning about the use of an uninitialized
variable:
drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c: In function 'cfs_cpt_table_create_pattern':
drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c:833:7: error: 'str' may be used uninitialized in this function [-Werror=maybe-uninitialized]
This part of the function used to not do anything as we would reassign
the 'str' pointer to something else right away, but now we pass an
uninitialized pointer into 'strchr', which can cause a kernel page fault
or worse.
Fixes: 239fd5d41f9b ("staging: lustre: libcfs: shortcut to create CPT from NUMA topology")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
index 464b27923ac0..6a31521f6ae0 100644
--- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
+++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
@@ -829,13 +829,6 @@ cfs_cpt_table_create_pattern(char *pattern)
int c;
int i;
- for (ncpt = 0;; ncpt++) { /* quick scan bracket */
- str = strchr(str, '[');
- if (!str)
- break;
- str++;
- }
-
str = cfs_trimwhite(pattern);
if (*str == 'n' || *str == 'N') {
pattern = str + 1;
--
2.9.0
Powered by blists - more mailing lists