summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adt7410.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-08-15 10:49:43 +0300
committerGuenter Roeck <linux@roeck-us.net>2012-09-23 21:08:33 -0700
commit37f9648b2745fc3830f3715a601f7f94296de838 (patch)
tree477929f36d0a629df45ed4ebb047e8fb775ade13 /drivers/hwmon/adt7410.c
parent983b97bed21e392280e80f704e97170b76cb7f3e (diff)
downloadop-kernel-dev-37f9648b2745fc3830f3715a601f7f94296de838.zip
op-kernel-dev-37f9648b2745fc3830f3715a601f7f94296de838.tar.gz
hwmon: (adt7410) handle errors from adt7410_update_device()
Smatch complains that adt7410_update_device() can return error pointers. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/adt7410.c')
-rw-r--r--drivers/hwmon/adt7410.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/hwmon/adt7410.c b/drivers/hwmon/adt7410.c
index f8606df..030c8d7 100644
--- a/drivers/hwmon/adt7410.c
+++ b/drivers/hwmon/adt7410.c
@@ -236,9 +236,14 @@ static ssize_t adt7410_show_t_hyst(struct device *dev,
char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
- struct adt7410_data *data = adt7410_update_device(dev);
+ struct adt7410_data *data;
int nr = attr->index;
- int hyst = (data->hyst & ADT7410_T_HYST_MASK) * 1000;
+ int hyst;
+
+ data = adt7410_update_device(dev);
+ if (IS_ERR(data))
+ return PTR_ERR(data);
+ hyst = (data->hyst & ADT7410_T_HYST_MASK) * 1000;
/*
* hysteresis is stored as a 4 bit offset in the device, convert it
OpenPOWER on IntegriCloud