Re: [PATCH] iio: adc: at91-sama5d2_adc: fix an error code in at91_adc_allocate_trigger()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Mar 2023 07:35:32 +0300
Dan Carpenter <error27@xxxxxxxxx> wrote:

> 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@xxxxxxxxx>
Seems obvious enough I've queued this up in the iio-fixes branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/at91-sama5d2_adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
> index b5d0c9ee284c..2a9fdc5b7edf 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);




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux