[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120413133906.GB26645@elgon.mountain>
Date: Fri, 13 Apr 2012 16:39:06 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Evgeniy Polyakov <zbr@...emap.net>
Cc: Markus Franke <franm@....tu-chemnitz.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] w1: w1_ds28e04: unlock on error path in w1_f1C_write_pio()
We should unlock here before returning.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists