summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2023-03-29 07:35:32 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2023-04-01 15:50:11 +0100
commit73a428b37b9b538f8f8fe61caa45e7f243bab87c (patch)
treec9fc7202ba48f036898126e9af5a35de2db8282c
parent4bffd2c7a3fc165fc70bc69211b8e6436f41a5c3 (diff)
downloadlinux-stable-73a428b37b9b538f8f8fe61caa45e7f243bab87c.tar.gz
linux-stable-73a428b37b9b538f8f8fe61caa45e7f243bab87c.tar.bz2
linux-stable-73a428b37b9b538f8f8fe61caa45e7f243bab87c.zip
iio: adc: at91-sama5d2_adc: fix an error code in at91_adc_allocate_trigger()
The at91_adc_allocate_trigger() function is supposed to return error pointers. Returning a NULL will cause an Oops. Fixes: 5e1a1da0f8c9 ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support") Signed-off-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.org/r/5d728f9d-31d1-410d-a0b3-df6a63a2c8ba@kili.mountain Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/at91-sama5d2_adc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index 50d02e5fc6fc..7258912fe17b 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -1409,7 +1409,7 @@ static struct iio_trigger *at91_adc_allocate_trigger(struct iio_dev *indio,
trig = devm_iio_trigger_alloc(&indio->dev, "%s-dev%d-%s", indio->name,
iio_device_id(indio), trigger_name);
if (!trig)
- return NULL;
+ return ERR_PTR(-ENOMEM);
trig->dev.parent = indio->dev.parent;
iio_trigger_set_drvdata(trig, indio);