From: Luis de Bethencourt <luisbg@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, knaack.h@gmx.de, lars@metafoo.de,
jic23@kernel.org, ciorneiioana@gmail.com,
janani.rvchndrn@gmail.com, afd@ti.com, linux-iio@vger.kernel.org,
devel@driverdev.osuosl.org,
Luis de Bethencourt <luisbg@osg.samsung.com>
Subject: [PATCH 2/2] staging: iio: accel: add error check
Date: Tue, 31 May 2016 22:08:04 +0100 [thread overview]
Message-ID: <1464728884-29686-2-git-send-email-luisbg@osg.samsung.com> (raw)
In-Reply-To: <1464728884-29686-1-git-send-email-luisbg@osg.samsung.com>
Go to error_ret if sca3000_read_ctrl_reg() failed.
Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---
Noticed this while inspecting the code for the 1/2 patch.
Thanks,
Luis
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
next prev parent reply other threads:[~2016-05-31 21:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 21:08 [PATCH 1/2] staging: iio: accel: fix " Luis de Bethencourt
2016-05-31 21:08 ` Luis de Bethencourt [this message]
2016-05-31 21:10 ` Luis de Bethencourt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1464728884-29686-2-git-send-email-luisbg@osg.samsung.com \
--to=luisbg@osg.samsung.com \
--cc=afd@ti.com \
--cc=ciorneiioana@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=janani.rvchndrn@gmail.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®