projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd69a18
)
w1: silence an uninitialized variable warning
author
Dan Carpenter
<dan.carpenter@oracle.com>
Thu, 14 Apr 2016 09:35:48 +0000
(12:35 +0300)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sun, 1 May 2016 21:04:19 +0000
(14:04 -0700)
If kstrtoint() returns -ERANGE then "tmp" is uninitialized.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Evgeniy Polaykov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/w1.c
patch
|
blob
|
history
diff --git
a/drivers/w1/w1.c
b/drivers/w1/w1.c
index 89a78475173810944411f1a61fa8236d56cb75e1..bb34362e930a2a1b3a6723e2b1e1274258fc98cc 100644
(file)
--- a/
drivers/w1/w1.c
+++ b/
drivers/w1/w1.c
@@
-335,7
+335,7
@@
static ssize_t w1_master_attribute_store_max_slave_count(struct device *dev,
int tmp;
struct w1_master *md = dev_to_w1_master(dev);
- if (kstrtoint(buf, 0, &tmp)
== -EINVAL
|| tmp < 1)
+ if (kstrtoint(buf, 0, &tmp) || tmp < 1)
return -EINVAL;
mutex_lock(&md->mutex);