Skip to contentSkip to conversation

Input: hp_sdc_rtc - unlock on error in hp_sdc_rtc_read_i8042timer()

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 14, 2013 – Nov 19, 2013

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

PATCH 1/1 Input: hp_sdc_rtc - unlock on error in hp_sdc_rtc_read_i8042timer()

The transaction task here is hp_sdc_tasklet() and it releases the lock. The problem is if we aren't able to queue the transaction then we need to release the lock ourselves.

drivers/input/misc/hp_sdc_rtc.c +4 -1
index 86b8228..45e0e3e 100644
@@ -180,7 +180,10 @@ static int64_t hp_sdc_rtc_read_i8042timer (uint8_t loadcmd, int numreg)
 	if (WARN_ON(down_interruptible(&i8042tregs)))
 		return -1;
 
-	if (hp_sdc_enqueue_transaction(&t)) return -1;
+	if (hp_sdc_enqueue_transaction(&t)) {
+		up(&i8042tregs);
+		return -1;
+	}
 	
 	/* Sleep until results come back. */
 	if (WARN_ON(down_interruptible(&i8042tregs)))
maintainer Applied
#1 lore raw
Quoted 5 lines · Dan Carpenter

The transaction task here is hp_sdc_tasklet() and it releases the lock. The problem is if we aren't able to queue the transaction then we need to release the lock ourselves.

Applied, thank you.

Quoted 17 lines
drivers/input/misc/hp_sdc_rtc.c +4 -1
index 86b8228..45e0e3e 100644
@@ -180,7 +180,10 @@ static int64_t hp_sdc_rtc_read_i8042timer (uint8_t loadcmd, int numreg)
 	if (WARN_ON(down_interruptible(&i8042tregs)))
 		return -1;
 
-	if (hp_sdc_enqueue_transaction(&t)) return -1;
+	if (hp_sdc_enqueue_transaction(&t)) {
+		up(&i8042tregs);
+		return -1;
+	}
 
 	/* Sleep until results come back. */
 	if (WARN_ON(down_interruptible(&i8042tregs)))
Signature · 1 line
Dmitry