From: Dan Carpenter Date: Fri, 13 Apr 2012 13:39:06 +0000 (+0300) Subject: w1: w1_ds28e04: unlock on error path in w1_f1C_write_pio() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=eda70f1dfc9e5165b9413dbf1ccb5c108f26a18c;p=openwrt%2Fstaging%2Fblogic.git w1: w1_ds28e04: unlock on error path in w1_f1C_write_pio() We should unlock here before returning. Signed-off-by: Dan Carpenter Acked-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/w1/slaves/w1_ds28e04.c b/drivers/w1/slaves/w1_ds28e04.c index f652db3782bf..4aa1aa90480d 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;