On Mon, 1 Nov 2021 14:30:43 +0100 Lars-Peter Clausen <lars@xxxxxxxxxx> wrote: > Registering a trigger can fail and the return value of > devm_iio_trigger_register() must be checked. Otherwise undefined behavior > can occur when the trigger is used. > > Fixes: 7c0299e879dd ("iio: adc: Add support for DLN2 ADC") > Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx> Seems obvious enough to pick up and won't go upstream until after the merge window anyway so time for any feedback to come in. Anyhow, applied to the fixes-togreg branch of iio.git and marked for stable. Thanks, Jonathan > --- > drivers/iio/adc/dln2-adc.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/dln2-adc.c b/drivers/iio/adc/dln2-adc.c > index 16407664182c..846c92296221 100644 > --- a/drivers/iio/adc/dln2-adc.c > +++ b/drivers/iio/adc/dln2-adc.c > @@ -656,7 +656,11 @@ static int dln2_adc_probe(struct platform_device *pdev) > return -ENOMEM; > } > iio_trigger_set_drvdata(dln2->trig, dln2); > - devm_iio_trigger_register(dev, dln2->trig); > + ret = devm_iio_trigger_register(dev, dln2->trig); > + if (ret) { > + dev_err(dev, "failed to register trigger: %d\n", ret); > + return ret; > + } > iio_trigger_set_immutable(indio_dev, dln2->trig); > > ret = devm_iio_triggered_buffer_setup(dev, indio_dev, NULL,