aboutsummaryrefslogtreecommitdiff
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorNathan Chancellor <natechancellor@gmail.com>2017-01-26 15:18:23 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:32:10 +0200
commitae3f281ed22d74530c4a1a51462f372f638e4764 (patch)
tree9e14847a81c90c577dbd0479d0c5e9ee8d71a930 /kernel/sysctl.c
parent17c3ec98dec6e216a581ebf638421674df1d5aef (diff)
sysctl: fix maybe-uninitialized warnings
kernel/sysctl.c: In function '__do_proc_dointvec.isra.3': kernel/sysctl.c:2030:8: warning: 'kbuf' may be used uninitialized in this function [-Wmaybe-uninitialized] char *tmp = skip_spaces(*buf); ^~~ kernel/sysctl.c:2183:8: note: 'kbuf' was declared here char *kbuf; ^~~~ kernel/sysctl.c: In function '__do_proc_doulongvec_minmax': kernel/sysctl.c:2030:8: warning: 'kbuf' may be used uninitialized in this function [-Wmaybe-uninitialized] char *tmp = skip_spaces(*buf); ^~~ kernel/sysctl.c:2433:8: note: 'kbuf' was declared here char *kbuf; ^~~~ This will be initialized to NULL normally. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 85d56cf97..4757d481b 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2006,7 +2006,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
int *i, vleft, first = 1, err = 0;
unsigned long page = 0;
size_t left;
- char *kbuf;
+ char *kbuf = NULL;
if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) {
*lenp = 0;
@@ -2256,7 +2256,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
int vleft, first = 1, err = 0;
unsigned long page = 0;
size_t left;
- char *kbuf;
+ char *kbuf = NULL;
if (!data || !table->maxlen || !*lenp || (*ppos && !write)) {
*lenp = 0;