summaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-04-14 11:35:48 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-05-01 23:04:19 +0200
commitb9c11a2333db7215876eca4ff5a39ee4f94909f2 (patch)
treee41ae7b5195c199a9e82491be3308ee15fa8dbf1 /drivers/w1
parenteeprom: 93xx46: Fix SPI device leak (diff)
downloadlinux-b9c11a2333db7215876eca4ff5a39ee4f94909f2.tar.xz
linux-b9c11a2333db7215876eca4ff5a39ee4f94909f2.zip
w1: silence an uninitialized variable warning
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>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/w1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 89a784751738..bb34362e930a 100644
--- 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);