linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: Fix error handling in vadc_do_conversion
@ 2021-03-01  8:16 Dinghao Liu
  2021-03-06 17:18 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2021-03-01  8:16 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Andy Gross, Bjorn Andersson, Jonathan Cameron,
	Lars-Peter Clausen, Peter Meerwald-Stadler, linux-arm-msm,
	linux-iio, linux-kernel

There is one vadc_poll_wait_eoc() call in vadc_do_conversion
that we have caught its return value but lack further handling.
Check and jump to err_disable label just like the other
vadc_poll_wait_eoc() in this function.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/iio/adc/qcom-spmi-vadc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/adc/qcom-spmi-vadc.c b/drivers/iio/adc/qcom-spmi-vadc.c
index 05ff948372b3..fe36b0ba8273 100644
--- a/drivers/iio/adc/qcom-spmi-vadc.c
+++ b/drivers/iio/adc/qcom-spmi-vadc.c
@@ -324,6 +324,8 @@ static int vadc_do_conversion(struct vadc_priv *vadc,
 
 	if (vadc->poll_eoc) {
 		ret = vadc_poll_wait_eoc(vadc, timeout);
+		if (ret)
+			goto err_disable;
 	} else {
 		ret = wait_for_completion_timeout(&vadc->complete, timeout);
 		if (!ret) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: adc: Fix error handling in vadc_do_conversion
  2021-03-01  8:16 [PATCH] iio: adc: Fix error handling in vadc_do_conversion Dinghao Liu
@ 2021-03-06 17:18 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2021-03-06 17:18 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: kjlu, Andy Gross, Bjorn Andersson, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-arm-msm, linux-iio, linux-kernel

On Mon,  1 Mar 2021 16:16:22 +0800
Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:

> There is one vadc_poll_wait_eoc() call in vadc_do_conversion
> that we have caught its return value but lack further handling.
> Check and jump to err_disable label just like the other
> vadc_poll_wait_eoc() in this function.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Looks good to me, but will leave this a little longer for others to review.
If it looks like I have forgotten it in 2 weeks time, feel free to remind
me!

Jonathan

> ---
>  drivers/iio/adc/qcom-spmi-vadc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/adc/qcom-spmi-vadc.c b/drivers/iio/adc/qcom-spmi-vadc.c
> index 05ff948372b3..fe36b0ba8273 100644
> --- a/drivers/iio/adc/qcom-spmi-vadc.c
> +++ b/drivers/iio/adc/qcom-spmi-vadc.c
> @@ -324,6 +324,8 @@ static int vadc_do_conversion(struct vadc_priv *vadc,
>  
>  	if (vadc->poll_eoc) {
>  		ret = vadc_poll_wait_eoc(vadc, timeout);
> +		if (ret)
> +			goto err_disable;
>  	} else {
>  		ret = wait_for_completion_timeout(&vadc->complete, timeout);
>  		if (!ret) {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-06 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01  8:16 [PATCH] iio: adc: Fix error handling in vadc_do_conversion Dinghao Liu
2021-03-06 17:18 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).