提交 159c8cdd 编写于 作者: A Axel Lin 提交者: Guenter Roeck

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 169c05cd
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册