Re: [PATCH 1/2] iio: mxs-lradc: Fix the order of resources removal

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

 



On 09/03/13 01:48, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> 
> Fix the order of resources removal in the error path of mxs_lradc_probe()
> and also in mxs_lradc_remove().
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
I 'think' this bug could cause actual trouble but I'll assume it is relatively unlikely
and have applied this to the togreg branch of iio.git (won't apply to the current fixes
branch).

Anyhow, applied to the togreg branch of iio.git

> ---
>  drivers/staging/iio/adc/mxs-lradc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index a08c173..75f5aac 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -987,7 +987,7 @@ static int mxs_lradc_probe(struct platform_device *pdev)
>  	/* Register the touchscreen input device. */
>  	ret = mxs_lradc_ts_register(lradc);
>  	if (ret)
> -		goto err_dev;
> +		goto err_ts_register;
>  
>  	/* Register IIO device. */
>  	ret = iio_device_register(iio);
> @@ -1000,6 +1000,8 @@ static int mxs_lradc_probe(struct platform_device *pdev)
>  
>  err_ts:
>  	mxs_lradc_ts_unregister(lradc);
> +err_ts_register:
> +	mxs_lradc_hw_stop(lradc);
>  err_dev:
>  	mxs_lradc_trigger_remove(iio);
>  err_trig:
> @@ -1012,13 +1014,11 @@ static int mxs_lradc_remove(struct platform_device *pdev)
>  	struct iio_dev *iio = platform_get_drvdata(pdev);
>  	struct mxs_lradc *lradc = iio_priv(iio);
>  
> +	iio_device_unregister(iio);
>  	mxs_lradc_ts_unregister(lradc);
> -
>  	mxs_lradc_hw_stop(lradc);
> -
> -	iio_device_unregister(iio);
> -	iio_triggered_buffer_cleanup(iio);
>  	mxs_lradc_trigger_remove(iio);
> +	iio_triggered_buffer_cleanup(iio);
>  
>  	return 0;
>  }
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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