2022-02-24 02:14:11

by Yang Yingliang

[permalink] [raw]
Subject: [PATCH -next] iio:accel:adxl367: fix missing unlock on error in adxl367_buffer_predisable()

Add the missing unlock before return from function adxl367_buffer_predisable()
in the error handling case.

Fixes: cbab791c5e2a ("iio: accel: add ADXL367 driver")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Yang Yingliang <[email protected]>
---
drivers/iio/accel/adxl367.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
index b452d74b1d4d..bdc95409abed 100644
--- a/drivers/iio/accel/adxl367.c
+++ b/drivers/iio/accel/adxl367.c
@@ -1359,7 +1359,7 @@ static int adxl367_buffer_predisable(struct iio_dev *indio_dev)

ret = adxl367_set_measure_en(st, true);
if (ret)
- return ret;
+ goto out;

ret = adxl367_set_temp_adc_mask_en(st, indio_dev->active_scan_mask,
false);
--
2.25.1


2022-02-24 11:11:05

by Tanislav, Cosmin

[permalink] [raw]
Subject: RE: [PATCH -next] iio:accel:adxl367: fix missing unlock on error in adxl367_buffer_predisable()

Reviewed-by: Cosmin Tanislav <[email protected]>

> -----Original Message-----
> From: Yang Yingliang <[email protected]>
> Sent: Thursday, February 24, 2022 4:03 AM
> To: [email protected]; [email protected]
> Cc: [email protected]; Tanislav, Cosmin <[email protected]>
> Subject: [PATCH -next] iio:accel:adxl367: fix missing unlock on error in
> adxl367_buffer_predisable()
>
> [External]
>
> Add the missing unlock before return from function
> adxl367_buffer_predisable()
> in the error handling case.
>
> Fixes: cbab791c5e2a ("iio: accel: add ADXL367 driver")
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Yang Yingliang <[email protected]>
> ---
> drivers/iio/accel/adxl367.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
> index b452d74b1d4d..bdc95409abed 100644
> --- a/drivers/iio/accel/adxl367.c
> +++ b/drivers/iio/accel/adxl367.c
> @@ -1359,7 +1359,7 @@ static int adxl367_buffer_predisable(struct iio_dev
> *indio_dev)
>
> ret = adxl367_set_measure_en(st, true);
> if (ret)
> - return ret;
> + goto out;
>
> ret = adxl367_set_temp_adc_mask_en(st, indio_dev-
> >active_scan_mask,
> false);
> --
> 2.25.1

2022-02-26 20:16:13

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH -next] iio:accel:adxl367: fix missing unlock on error in adxl367_buffer_predisable()

On Thu, 24 Feb 2022 09:38:06 +0000
"Tanislav, Cosmin" <[email protected]> wrote:

> Reviewed-by: Cosmin Tanislav <[email protected]>
Sorry. I normally try to pick up the earliest fix when I get
multiple fixes for the same thing but I failed to notice
yours before applying the one Dan sent out!

As a result I've already picked that one up

Thanks for the patch though and I'll check more carefully next
time!

Jonathan

>
> > -----Original Message-----
> > From: Yang Yingliang <[email protected]>
> > Sent: Thursday, February 24, 2022 4:03 AM
> > To: [email protected]; [email protected]
> > Cc: [email protected]; Tanislav, Cosmin <[email protected]>
> > Subject: [PATCH -next] iio:accel:adxl367: fix missing unlock on error in
> > adxl367_buffer_predisable()
> >
> > [External]
> >
> > Add the missing unlock before return from function
> > adxl367_buffer_predisable()
> > in the error handling case.
> >
> > Fixes: cbab791c5e2a ("iio: accel: add ADXL367 driver")
> > Reported-by: Hulk Robot <[email protected]>
> > Signed-off-by: Yang Yingliang <[email protected]>
> > ---
> > drivers/iio/accel/adxl367.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
> > index b452d74b1d4d..bdc95409abed 100644
> > --- a/drivers/iio/accel/adxl367.c
> > +++ b/drivers/iio/accel/adxl367.c
> > @@ -1359,7 +1359,7 @@ static int adxl367_buffer_predisable(struct iio_dev
> > *indio_dev)
> >
> > ret = adxl367_set_measure_en(st, true);
> > if (ret)
> > - return ret;
> > + goto out;
> >
> > ret = adxl367_set_temp_adc_mask_en(st, indio_dev-
> > >active_scan_mask,
> > false);
> > --
> > 2.25.1
>