Re: [RESEND PATCH v2 2/2] staging: iio: accel: add error check

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

 



On 22/06/16 20:43, Luis de Bethencourt wrote:
> Go to error_ret if sca3000_read_ctrl_reg() failed.
> 
> Signed-off-by: Luis de Bethencourt <luisbg@xxxxxxxxxxxxxxx>
Applied to the togreg branch of iio.git - will be initially
pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/staging/iio/accel/sca3000_core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
> index ec12181..b3f6dbf 100644
> --- a/drivers/staging/iio/accel/sca3000_core.c
> +++ b/drivers/staging/iio/accel/sca3000_core.c
> @@ -1046,6 +1046,8 @@ static int sca3000_clean_setup(struct sca3000_state *st)
>  
>  	/* Disable ring buffer */
>  	ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL);
> +	if (ret < 0)
> +		goto error_ret;
>  	ret = sca3000_write_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL,
>  				     (ret & SCA3000_OUT_CTRL_PROT_MASK)
>  				     | SCA3000_OUT_CTRL_BUF_X_EN
> 

--
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