mirror of
https://github.com/torvalds/linux.git
synced 2026-01-12 00:42:35 +08:00
iio: chemical: mhz19b: Fix error code in probe()
Return -ENOMEM if devm_iio_device_alloc() fails. Don't return success.
Fixes: 4572a70b36 ("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>
This commit is contained in:
committed by
Jonathan Cameron
parent
04c1290776
commit
805bbd3ac9
@@ -276,7 +276,7 @@ static int mhz19b_probe(struct serdev_device *serdev)
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user