Skip to contentSkip to conversation

hwmon: (lm90) Add missing assignment

PATCH In review Guenter Roeck 2 participants 2 messages Jul 25, 2016 – Jul 26, 2016

Subsystems (2)
lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 hwmon: (lm90) Add missing assignment

Coverity reports the following error.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

CID 1364474: Error handling issues (CHECKED_RETURN) Calling "lm90_read_reg" without checking return value (as is done elsewhere 28 out of 29 times).

532 lm90_read_reg(client, LM90_REG_R_REMOTE_LOWH);
533 if (val < 0)
534 return val;

---
 drivers/hwmon/lm90.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/lm90.c +1 -1
index f51e758ba529..7b3eedf76c62 100644
@@ -529,7 +529,7 @@ static int lm90_update_limits(struct device *dev)
 		return val;
 	data->temp_hyst = val;
 
-	lm90_read_reg(client, LM90_REG_R_REMOTE_LOWH);
+	val = lm90_read_reg(client, LM90_REG_R_REMOTE_LOWH);
 	if (val < 0)
 		return val;
 	data->temp11[REMOTE_LOW] = val << 8;
Signature · 1 line
2.5.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Guenter,

Quoted 19 lines · Guenter Roeck

Coverity reports the following error.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

CID 1364474: Error handling issues (CHECKED_RETURN) Calling "lm90_read_reg" without checking return value (as is done elsewhere 28 out of 29 times).

532 lm90_read_reg(client, LM90_REG_R_REMOTE_LOWH);
533 if (val < 0)
534 return val;

---
 drivers/hwmon/lm90.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/lm90.c +0 -0
index f51e758ba529..7b3eedf76c62 100644

drivers/hwmon/lm90.c static int lm90_update_limits(struct device *dev) · line 535

Quoted 8 lines
drivers/hwmon/lm90.c +1 -1
@@ -529,7 +529,7 @@ static int lm90_update_limits(struct device *dev)
 		return val;
 	data->temp_hyst = val;
 
-	lm90_read_reg(client, LM90_REG_R_REMOTE_LOWH);
+	val = lm90_read_reg(client, LM90_REG_R_REMOTE_LOWH);
 	if (val < 0)
 		return val;
 	data->temp11[REMOTE_LOW] = val << 8;

Good catch.

Signature · 2 lines
Jean Delvare
SUSE L3 Support