diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-04-14 11:35:48 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-01 23:04:19 +0200 |
commit | b9c11a2333db7215876eca4ff5a39ee4f94909f2 (patch) | |
tree | e41ae7b5195c199a9e82491be3308ee15fa8dbf1 /drivers/w1/w1.c | |
parent | eeprom: 93xx46: Fix SPI device leak (diff) | |
download | linux-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/w1.c')
-rw-r--r-- | drivers/w1/w1.c | 2 |
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); |