aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-05-13 09:37:26 -0400
committerGuenter Roeck <linux@roeck-us.net>2013-05-13 09:43:14 -0400
commit159c8cddd9259e9379f37f0a69ddcbb01c4e8b77 (patch)
treea1cb16d4e7d1f0e5acc8e6e8e7d7aca48e957068
parent169c05cd54473ba4cc37bf4d22e7631395d14f68 (diff)
hwmon: (iio_hwmon) Fix null pointer dereference
This patch fixes the null pointer dereference in goto error_release_channels path when allocate memory for st fails. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/iio_hwmon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
index 368497fa2627..52b77afebde1 100644
--- a/drivers/hwmon/iio_hwmon.c
+++ b/drivers/hwmon/iio_hwmon.c
@@ -161,7 +161,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
161error_remove_group: 161error_remove_group:
162 sysfs_remove_group(&dev->kobj, &st->attr_group); 162 sysfs_remove_group(&dev->kobj, &st->attr_group);
163error_release_channels: 163error_release_channels:
164 iio_channel_release_all(st->channels); 164 iio_channel_release_all(channels);
165 return ret; 165 return ret;
166} 166}
167 167