Skip to content

Commit

Permalink
hwmon: (max6621) Inverted if condition in max6621_read()
Browse files Browse the repository at this point in the history
We intended to test for failure here but accidentally tested for
success.  It means that we don't set "*val" to true and it means that
if i2c_smbus_write_byte() does fail then we return success.

Fixes: e7895864b0d7 ("hwmon: (max6621) Add support for Maxim MAX6621 temperature sensor")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Dan Carpenter authored and Guenter Roeck committed Oct 30, 2017
1 parent a3bdc5b commit 5813da1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/max6621.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ max6621_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
if (regval) {
ret = i2c_smbus_write_byte(data->client,
MAX6621_CLEAR_ALERT_REG);
if (!ret)
if (ret)
return ret;
}

Expand Down

0 comments on commit 5813da1

Please sign in to comment.