Skip to content

Commit

Permalink
w1: w1_ds28e04: unlock on error path in w1_f1C_write_pio()
Browse files Browse the repository at this point in the history
We should unlock here before returning.

Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Evgeniy Polyakov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Dan Carpenter authored and gregkh committed Apr 18, 2012
1 parent 8f1e125 commit eda70f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/w1/slaves/w1_ds28e04.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eda70f1

Please sign in to comment.