From: Alexey Khoroshilov <khoroshilov@ispras.ru>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
patches@opensource.wolfsonmicro.com,
linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org
Subject: [PATCH] extcon: arizona: unlock mutex on error path in arizona_micdet()
Date: Sun, 4 Nov 2012 13:19:46 -0700 [thread overview]
Message-ID: <1352060386-13610-1-git-send-email-khoroshilov@ispras.ru> (raw)
If regmap_read() failed, arizona_micdet() returns IRQ_NONE
leaving &info->lock mutex locked as opposed to all other return paths.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/extcon/extcon-arizona.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index cdab9e5..d876a54 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -166,6 +166,7 @@ static irqreturn_t arizona_micdet(int irq, void *data)
ret = regmap_read(arizona->regmap, ARIZONA_MIC_DETECT_3, &val);
if (ret != 0) {
dev_err(arizona->dev, "Failed to read MICDET: %d\n", ret);
+ mutex_unlock(&info->lock);
return IRQ_NONE;
}
--
1.7.9.5
next reply other threads:[~2012-11-04 20:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-04 20:19 Alexey Khoroshilov [this message]
2012-11-05 8:04 ` [PATCH] extcon: arizona: unlock mutex on error path in arizona_micdet() Mark Brown
2012-11-05 8:37 ` Chanwoo Choi
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=1352060386-13610-1-git-send-email-khoroshilov@ispras.ru \
--to=khoroshilov@ispras.ru \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=cw00.choi@samsung.com \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=patches@opensource.wolfsonmicro.com \
/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;
as well as URLs for NNTP newsgroup(s).