Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: core: Fix an error pointer vs NULL bug in devm_iio_device_alloc()

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>

authored by

Dan Carpenter and committed by
Jonathan Cameron
43fa7394 2a1c6a77

+1 -1
+1 -1
drivers/iio/industrialio-core.c
··· 1711 1711 ret = devm_add_action_or_reset(parent, devm_iio_device_release, 1712 1712 iio_dev); 1713 1713 if (ret) 1714 - return ERR_PTR(ret); 1714 + return NULL; 1715 1715 1716 1716 return iio_dev; 1717 1717 }