Skip to content

Commit

Permalink
Input: hp_sdc_rtc - unlock on error in hp_sdc_rtc_read_i8042timer()
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Dan Carpenter authored and Dmitry Torokhov committed Nov 21, 2013
1 parent 0221e67 commit b64da05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/input/misc/hp_sdc_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit b64da05

Please sign in to comment.