Skip to content

Commit

Permalink
iio: adc: at91-sama5d2_adc: fix an error code in at91_adc_allocate_tr…
Browse files Browse the repository at this point in the history
…igger()

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]>
  • Loading branch information
error27 authored and jic23 committed Apr 1, 2023
1 parent 4bffd2c commit 73a428b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/adc/at91-sama5d2_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 73a428b

Please sign in to comment.