Skip to content

Commit

Permalink
hwmon: (iio_hwmon) Fix null pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Guenter Roeck committed May 13, 2013
1 parent 169c05c commit 159c8cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/iio_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
error_remove_group:
sysfs_remove_group(&dev->kobj, &st->attr_group);
error_release_channels:
iio_channel_release_all(st->channels);
iio_channel_release_all(channels);
return ret;
}

Expand Down

0 comments on commit 159c8cd

Please sign in to comment.