The devm_iio_device_alloc() function is supposed to return NULL and not
error pointers. Returning an error pointer will lead to a crash in the
callers.
Fixes:
cf5724e91515 ("iio: core: simplify some devm functions")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/YJ+a1yaMu2QNATgt@mwanda
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
ret = devm_add_action_or_reset(parent, devm_iio_device_release,
iio_dev);
if (ret)
- return ERR_PTR(ret);
+ return NULL;
return iio_dev;
}