Skip to contentSkip to conversation

w1: w1_ds28e04: unlock on error path in w1_f1C_write_pio()

PATCH In review Dan Carpenter 2 participants 2 messages Apr 13, 2012 – Apr 14, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 w1: w1_ds28e04: unlock on error path in w1_f1C_write_pio()

We should unlock here before returning.

drivers/w1/slaves/w1_ds28e04.c +3 -1
index f652db3..4aa1aa9 100644
@@ -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;