aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83781d.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-05-08 14:27:28 -0400
committerJean Delvare <khali@linux-fr.org>2009-05-08 14:27:28 -0400
commit848ddf116b3d1711c956fac8627be12dfe8d736f (patch)
tree59b9f5dcd4b652e127f0908ab162536d588ad0fc /drivers/hwmon/w83781d.c
parentb9008708f24de8fb9bdbfb5d3b27e36d5a357eda (diff)
hwmon: (w83781d) Fix W83782D support (NULL pointer dereference)
Commit 360782dde00a2e6e7d9fd57535f90934707ab8a8 (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
Diffstat (limited to 'drivers/hwmon/w83781d.c')
-rw-r--r--drivers/hwmon/w83781d.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index dbfb30c588d8..0bdab959b736 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1462,7 +1462,8 @@ static struct w83781d_data *w83781d_update_device(struct device *dev)
1462 data->pwm[i] = 1462 data->pwm[i] =
1463 w83781d_read_value(data, 1463 w83781d_read_value(data,
1464 W83781D_REG_PWM[i]); 1464 W83781D_REG_PWM[i]);
1465 if ((data->type != w83782d || !client->driver) 1465 /* Only W83782D on SMBus has PWM3 and PWM4 */
1466 if ((data->type != w83782d || !client)
1466 && i == 1) 1467 && i == 1)
1467 break; 1468 break;
1468 } 1469 }