Skip to contentSkip to conversation

Input: lm8323 - missing error check in lm8323_set_disable()

PATCH Applied Dan Carpenter 2 participants 2 messages Dec 2, 2014 – Dec 3, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: lm8323 - missing error check in lm8323_set_disable()

The missing error handling here is not especially harmful but static checkers complain that "i" can be used uninitialized.

drivers/input/keyboard/lm8323.c +2 -0
index cb32e2b..21bea52 100644
@@ -616,6 +616,8 @@ static ssize_t lm8323_set_disable(struct device *dev,
 	unsigned int i;
 
 	ret = kstrtouint(buf, 10, &i);
+	if (ret)
+		return ret;
 
 	mutex_lock(&lm->lock);
 	lm->kp_enabled = !i;
maintainer Applied
#1 lore raw
Quoted 4 lines · Dan Carpenter

The missing error handling here is not especially harmful but static checkers complain that "i" can be used uninitialized.

Applied, thank you.

Quoted 14 lines
drivers/input/keyboard/lm8323.c +2 -0
index cb32e2b..21bea52 100644
@@ -616,6 +616,8 @@ static ssize_t lm8323_set_disable(struct device *dev,
 	unsigned int i;
 
 	ret = kstrtouint(buf, 10, &i);
+	if (ret)
+		return ret;
 
 	mutex_lock(&lm->lock);
 	lm->kp_enabled = !i;
Signature · 1 line
Dmitry