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>
This commit is contained in:
Dan Carpenter 2016-04-14 12:35:48 +03:00 committed by Greg Kroah-Hartman
parent dd69a18ae7
commit b9c11a2333
1 changed files with 1 additions and 1 deletions

View File

@ -335,7 +335,7 @@ static ssize_t w1_master_attribute_store_max_slave_count(struct device *dev,
int tmp; int tmp;
struct w1_master *md = dev_to_w1_master(dev); 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; return -EINVAL;
mutex_lock(&md->mutex); mutex_lock(&md->mutex);