From: Roberta Dobrescu <roberta.dobrescu@gmail.com>
To: linux-iio@vger.kernel.org
Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de,
pmeerw@pmeerw.net, daniel.baluta@intel.com,
dan.carpenter@oracle.com, kbuild@01.org,
Roberta Dobrescu <roberta.dobrescu@gmail.com>
Subject: [PATCH] staging: iio: light: isl29018: Add missing mutex_unlock on error path
Date: Tue, 28 Apr 2015 20:09:27 +0300 [thread overview]
Message-ID: <1430240967-2459-1-git-send-email-roberta.dobrescu@gmail.com> (raw)
This patch fixes the following warning:
drivers/staging/iio/light/isl29018.c:386 isl29018_write_raw() warn:
inconsistent returns 'mutex:&chip->lock'.
Locked on: line 374
Unlocked on: line 386
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/staging/iio/light/isl29018.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 435d417..08ca9a4 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -370,8 +370,10 @@ static int isl29018_write_raw(struct iio_dev *indio_dev,
break;
case IIO_CHAN_INFO_INT_TIME:
if (chan->type == IIO_LIGHT)
- if (val != 0)
+ if (val != 0) {
+ mutex_unlock(&chip->lock);
return -EINVAL;
+ }
ret = isl29018_set_integration_time(chip, val2);
break;
case IIO_CHAN_INFO_SCALE:
--
1.9.1
next reply other threads:[~2015-04-28 17:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 17:09 Roberta Dobrescu [this message]
2015-04-30 20:56 ` [PATCH] staging: iio: light: isl29018: Add missing mutex_unlock on error path Jonathan Cameron
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=1430240967-2459-1-git-send-email-roberta.dobrescu@gmail.com \
--to=roberta.dobrescu@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=daniel.baluta@intel.com \
--cc=jic23@kernel.org \
--cc=kbuild@01.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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