Return -ENOMEM if devm_iio_device_alloc() fails. Don't return success.
Fixes:
4572a70b3681 ("iio: chemical: Add support for Winsen MHZ19B CO2 sensor")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Acked-by: Gyeyoung Baek <gye976@gmail.com>
Link: https://patch.msgid.link/aBtZFLFlr0slcYSi@stanley.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
if (!indio_dev)
- return ret;
+ return -ENOMEM;
serdev_device_set_drvdata(serdev, indio_dev);
st = iio_priv(indio_dev);