Skip to content

Commit

Permalink
hwmon: (w83781d) Fix W83782D support (NULL pointer dereference)
Browse files Browse the repository at this point in the history
Commit 360782d (hwmon: (w83781d) Stop
abusing struct i2c_client for ISA devices) broke W83782D support for
devices connected on the ISA bus. You will hit a NULL pointer
dereference as soon as you read any device attribute. Other devices,
and W83782D devices on the SMBus, aren't affected.

Reported-by: Michel Abraham
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Michel Abraham
  • Loading branch information
Jean Delvare committed May 8, 2009
1 parent b900870 commit 848ddf1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hwmon/w83781d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,8 @@ static struct w83781d_data *w83781d_update_device(struct device *dev)
data->pwm[i] =
w83781d_read_value(data,
W83781D_REG_PWM[i]);
if ((data->type != w83782d || !client->driver)
/* Only W83782D on SMBus has PWM3 and PWM4 */
if ((data->type != w83782d || !client)
&& i == 1)
break;
}
Expand Down

0 comments on commit 848ddf1

Please sign in to comment.