Skip to content

Commit 73a428b

Browse files
error27jic23
authored andcommitted
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: 5e1a1da ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 4bffd2c commit 73a428b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/at91-sama5d2_adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ static struct iio_trigger *at91_adc_allocate_trigger(struct iio_dev *indio,
14091409
trig = devm_iio_trigger_alloc(&indio->dev, "%s-dev%d-%s", indio->name,
14101410
iio_device_id(indio), trigger_name);
14111411
if (!trig)
1412-
return NULL;
1412+
return ERR_PTR(-ENOMEM);
14131413

14141414
trig->dev.parent = indio->dev.parent;
14151415
iio_trigger_set_drvdata(trig, indio);

0 commit comments

Comments
 (0)