From: Dan Carpenter Date: Thu, 14 Apr 2016 09:35:48 +0000 (+0300) Subject: w1: silence an uninitialized variable warning X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b9c11a2333db7215876eca4ff5a39ee4f94909f2;p=openwrt%2Fstaging%2Fblogic.git w1: silence an uninitialized variable warning If kstrtoint() returns -ERANGE then "tmp" is uninitialized. Signed-off-by: Dan Carpenter Acked-by: Evgeniy Polaykov Signed-off-by: Greg Kroah-Hartman --- 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);