* [RESEND PATCH v2 1/2] staging: iio: accel: fix error check
@ 2016-06-22 19:43 Luis de Bethencourt
2016-06-22 19:43 ` [RESEND PATCH v2 2/2] staging: iio: accel: add " Luis de Bethencourt
2016-06-26 14:58 ` [RESEND PATCH v2 1/2] staging: iio: accel: fix " Jonathan Cameron
0 siblings, 2 replies; 4+ messages in thread
From: Luis de Bethencourt @ 2016-06-22 19:43 UTC (permalink / raw)
To: linux-kernel
Cc: gregkh, jic23, knaack.h, lars, pmeerw, ciorneiioana, afd,
janani.rvchndrn, linux-iio, devel, Luis de Bethencourt
sca3000_read_ctrl_reg() returns a negative number on failure, check for
this instead of zero.
Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Reviewed-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Jonathan Cameron <jic23@kernel.org>
---
drivers/staging/iio/accel/sca3000_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
index a8f533a..ec12181 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -594,7 +594,7 @@ static ssize_t sca3000_read_frequency(struct device *dev,
goto error_ret_mut;
ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL);
mutex_unlock(&st->lock);
- if (ret)
+ if (ret < 0)
goto error_ret;
val = ret;
if (base_freq > 0)
--
2.5.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RESEND PATCH v2 2/2] staging: iio: accel: add error check
2016-06-22 19:43 [RESEND PATCH v2 1/2] staging: iio: accel: fix error check Luis de Bethencourt
@ 2016-06-22 19:43 ` Luis de Bethencourt
2016-06-26 15:00 ` Jonathan Cameron
2016-06-26 14:58 ` [RESEND PATCH v2 1/2] staging: iio: accel: fix " Jonathan Cameron
1 sibling, 1 reply; 4+ messages in thread
From: Luis de Bethencourt @ 2016-06-22 19:43 UTC (permalink / raw)
To: linux-kernel
Cc: gregkh, jic23, knaack.h, lars, pmeerw, ciorneiioana, afd,
janani.rvchndrn, linux-iio, devel, Luis de Bethencourt
Go to error_ret if sca3000_read_ctrl_reg() failed.
Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---
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
--
2.5.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RESEND PATCH v2 1/2] staging: iio: accel: fix error check
2016-06-22 19:43 [RESEND PATCH v2 1/2] staging: iio: accel: fix error check Luis de Bethencourt
2016-06-22 19:43 ` [RESEND PATCH v2 2/2] staging: iio: accel: add " Luis de Bethencourt
@ 2016-06-26 14:58 ` Jonathan Cameron
1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2016-06-26 14:58 UTC (permalink / raw)
To: Luis de Bethencourt, linux-kernel
Cc: gregkh, knaack.h, lars, pmeerw, ciorneiioana, afd,
janani.rvchndrn, linux-iio, devel
On 22/06/16 20:43, Luis de Bethencourt wrote:
> sca3000_read_ctrl_reg() returns a negative number on failure, check for
> this instead of zero.
>
> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
> Reviewed-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Jonathan Cameron <jic23@kernel.org>
Note that, like any tag, reviewed-by tags must be provided by the person
who did the review. It's nice to acknowledge reviewers, but there is
a certain "I'm happy with the result of my review" that is associated
with a reviewed-by tag.
Marked for stable and applied to the fixes-togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/staging/iio/accel/sca3000_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
> index a8f533a..ec12181 100644
> --- a/drivers/staging/iio/accel/sca3000_core.c
> +++ b/drivers/staging/iio/accel/sca3000_core.c
> @@ -594,7 +594,7 @@ static ssize_t sca3000_read_frequency(struct device *dev,
> goto error_ret_mut;
> ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL);
> mutex_unlock(&st->lock);
> - if (ret)
> + if (ret < 0)
> goto error_ret;
> val = ret;
> if (base_freq > 0)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RESEND PATCH v2 2/2] staging: iio: accel: add error check
2016-06-22 19:43 ` [RESEND PATCH v2 2/2] staging: iio: accel: add " Luis de Bethencourt
@ 2016-06-26 15:00 ` Jonathan Cameron
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2016-06-26 15:00 UTC (permalink / raw)
To: Luis de Bethencourt, linux-kernel
Cc: gregkh, knaack.h, lars, pmeerw, ciorneiioana, afd,
janani.rvchndrn, linux-iio, devel
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@osg.samsung.com>
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-26 15:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-22 19:43 [RESEND PATCH v2 1/2] staging: iio: accel: fix error check Luis de Bethencourt
2016-06-22 19:43 ` [RESEND PATCH v2 2/2] staging: iio: accel: add " Luis de Bethencourt
2016-06-26 15:00 ` Jonathan Cameron
2016-06-26 14:58 ` [RESEND PATCH v2 1/2] staging: iio: accel: fix " 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).