Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 159c8cdd authored by Axel Lin's avatar Axel Lin Committed by Guenter Roeck
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 169c05cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}