Skip to content

Commit 805bbd3

Browse files
Dan Carpenterjic23
authored andcommitted
iio: chemical: mhz19b: Fix error code in probe()
Return -ENOMEM if devm_iio_device_alloc() fails. Don't return success. Fixes: 4572a70 ("iio: chemical: Add support for Winsen MHZ19B CO2 sensor") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: David Lechner <[email protected]> Acked-by: Gyeyoung Baek <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 04c1290 commit 805bbd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/chemical/mhz19b.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static int mhz19b_probe(struct serdev_device *serdev)
276276

277277
indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
278278
if (!indio_dev)
279-
return ret;
279+
return -ENOMEM;
280280
serdev_device_set_drvdata(serdev, indio_dev);
281281

282282
st = iio_priv(indio_dev);

0 commit comments

Comments
 (0)