From: Dan Carpenter <dan.carpenter@oracle.com>
To: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Markus Franke <franm@hrz.tu-chemnitz.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] w1: w1_ds28e04: unlock on error path in w1_f1C_write_pio()
Date: Fri, 13 Apr 2012 16:39:06 +0300 [thread overview]
Message-ID: <20120413133906.GB26645@elgon.mountain> (raw)
We should unlock here before returning.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/w1/slaves/w1_ds28e04.c b/drivers/w1/slaves/w1_ds28e04.c
index f652db3..4aa1aa9 100644
--- a/drivers/w1/slaves/w1_ds28e04.c
+++ b/drivers/w1/slaves/w1_ds28e04.c
@@ -309,8 +309,10 @@ static ssize_t w1_f1C_write_pio(struct file *filp, struct kobject *kobj,
mutex_lock(&sl->master->mutex);
/* Write the PIO data */
- if (w1_reset_select_slave(sl))
+ if (w1_reset_select_slave(sl)) {
+ mutex_unlock(&sl->master->mutex);
return -1;
+ }
/* set bit 7..2 to value '1' */
*buf = *buf | 0xFC;
next reply other threads:[~2012-04-13 13:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 13:39 Dan Carpenter [this message]
2012-04-14 19:06 ` Evgeniy Polyakov
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=20120413133906.GB26645@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=franm@hrz.tu-chemnitz.de \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zbr@ioremap.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
all inboxes | Powered by JetHome®