w1: w1_ds28e04: unlock on error path in w1_f1C_write_pio()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 13 Apr 2012 13:39:06 +0000 (16:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Apr 2012 22:37:35 +0000 (15:37 -0700)
We should unlock here before returning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/slaves/w1_ds28e04.c

index f652db3782bfc03951130d2eff47433a75c6a402..4aa1aa90480d939e8fb648257780a46a7f3457c8 100644 (file)
@@ -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;