From: Dan Carpenter Date: Tue, 19 Nov 2013 21:28:06 +0000 (-0800) Subject: Input: hp_sdc_rtc - unlock on error in hp_sdc_rtc_read_i8042timer() X-Git-Tag: v3.13-rc2~32^2^2~2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b64da05fb746c6ff5bcb9abeaa52684d1b08a2b9;p=~emulex%2Finfiniband.git 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. Signed-off-by: Dan Carpenter Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c index 86b822806e9..45e0e3e55de 100644 --- a/drivers/input/misc/hp_sdc_rtc.c +++ b/drivers/input/misc/hp_sdc_rtc.c @@ -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)))