* [patch] Input: hp_sdc_rtc - unlock on error in hp_sdc_rtc_read_i8042timer()
@ 2013-11-14 8:18 Dan Carpenter
2013-11-19 21:28 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-11-14 8:18 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Helge Deller, David Howells, linux-input, kernel-janitors
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>
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
index 86b8228..45e0e3e 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)))
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] Input: hp_sdc_rtc - unlock on error in hp_sdc_rtc_read_i8042timer()
2013-11-14 8:18 [patch] Input: hp_sdc_rtc - unlock on error in hp_sdc_rtc_read_i8042timer() Dan Carpenter
@ 2013-11-19 21:28 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2013-11-19 21:28 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Helge Deller, David Howells, linux-input, kernel-janitors
On Thu, Nov 14, 2013 at 11:18:08AM +0300, Dan Carpenter wrote:
> 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>
Applied, thank you.
>
> diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
> index 86b8228..45e0e3e 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)))
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-19 21:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14 8:18 [patch] Input: hp_sdc_rtc - unlock on error in hp_sdc_rtc_read_i8042timer() Dan Carpenter
2013-11-19 21:28 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).