Anton Blanchard
320718ee07
hvc_console: Fix race between hvc_close and hvc_remove
...
I don't claim to understand the tty layer, but it seems like hvc_open and
hvc_close should be balanced in their kref reference counting.
Right now we get a kref every call to hvc_open:
if (hp->count++ > 0) {
tty_kref_get(tty); <----- here
spin_unlock_irqrestore(&hp->lock, flags);
hvc_kick();
return 0;
} /* else count == 0 */
tty->driver_data = hp;
hp->tty = tty_kref_get(tty); <------ or here if hp->count was 0
But hvc_close has:
tty_kref_get(tty);
if (--hp->count == 0) {
...
/* Put the ref obtained in hvc_open() */
tty_kref_put(tty);
...
}
tty_kref_put(tty);
Since the outside kref get/put balance we only do a single kref_put when
count reaches 0.
The patch below changes things to call tty_kref_put once for every
hvc_close call, and with that my machine boots fine.
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-04-08 09:46:20 +09:30
..
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-08 16:55:37 +01:00
2010-03-19 07:12:12 -07:00
2009-09-24 07:21:03 -07:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-04-07 08:38:02 -07:00
2009-10-01 16:11:11 -07:00
2010-02-09 11:13:56 +01:00
2010-03-30 22:02:32 +09:00
2009-10-01 16:11:11 -07:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-01-06 15:59:30 -08:00
2008-12-13 11:25:49 -08:00
2009-10-14 17:36:48 +02:00
2010-03-30 22:02:32 +09:00
2008-03-03 14:53:16 -08:00
2008-10-20 08:52:41 -07:00
2008-12-13 09:12:07 +00:00
2010-03-30 22:02:32 +09:00
2009-10-04 15:05:10 -07:00
2009-12-16 07:19:59 -08:00
2010-03-30 22:02:32 +09:00
2008-07-20 17:12:36 -07:00
2009-10-14 17:36:49 +02:00
2010-03-30 22:02:32 +09:00
2009-10-13 10:20:16 -07:00
2008-02-03 17:11:42 +02:00
2010-03-30 22:02:32 +09:00
2010-02-25 15:38:37 -08:00
2010-04-08 09:46:20 +09:30
2010-02-24 14:22:32 +10:30
2009-01-13 14:48:01 +11:00
2010-03-08 16:55:37 +01:00
2010-03-30 22:02:32 +09:00
2010-02-24 14:22:32 +10:30
2010-02-24 14:22:32 +10:30
2010-02-24 14:22:32 +10:30
2010-02-24 14:22:32 +10:30
2010-03-30 22:02:32 +09:00
2009-08-20 10:29:28 +10:00
2009-01-02 10:28:32 -08:00
2010-03-30 22:02:32 +09:00
2009-12-11 15:18:06 -08:00
2010-02-24 14:22:53 +10:30
2010-02-04 00:25:19 -08:00
2009-12-10 22:55:36 +01:00
2009-12-11 15:18:03 -08:00
2010-03-30 22:02:32 +09:00
2008-02-07 08:42:25 -08:00
2010-04-07 08:38:05 -07:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2008-04-30 08:29:43 -07:00
2009-12-04 15:39:55 +01:00
2010-04-07 08:38:03 -07:00
2008-04-30 08:29:49 -07:00
2009-07-12 12:22:34 -07:00
2009-12-04 15:39:55 +01:00
2010-03-12 15:52:43 -08:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2009-12-19 23:36:00 +00:00
2009-10-14 17:36:52 +02:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-02-04 11:55:45 +01:00
2010-04-07 08:38:04 -07:00
2009-12-11 15:18:06 -08:00
2008-07-20 17:12:38 -07:00
2009-01-02 10:19:39 -08:00
2009-07-12 12:22:34 -07:00
2009-01-02 10:19:39 -08:00
2009-11-18 08:37:40 -08:00
2009-02-22 09:23:02 -08:00
2009-10-14 17:36:53 +02:00
2009-06-11 08:51:01 -07:00
2009-10-11 11:20:58 -07:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2008-10-16 09:24:42 -07:00
2008-04-18 22:22:54 -04:00
2010-03-30 22:02:32 +09:00
2008-07-20 17:12:38 -07:00
2010-03-30 22:02:32 +09:00
2009-12-11 15:18:06 -08:00
2009-07-12 12:22:34 -07:00
2008-02-07 08:42:33 -08:00
2010-03-02 14:43:08 -08:00
2010-03-02 14:43:16 -08:00
2009-09-01 01:13:31 -07:00
2010-03-30 22:02:32 +09:00
2009-10-14 17:36:53 +02:00
2009-10-11 11:20:58 -07:00
2010-01-04 12:31:21 -08:00
2010-03-30 22:02:32 +09:00
2010-03-19 07:17:55 -07:00
2010-04-02 19:44:09 -07:00
2009-11-09 09:40:54 +01:00
2010-03-02 14:43:22 -08:00
2010-03-19 07:17:57 -07:00
2010-01-27 11:33:53 +01:00
2009-07-20 16:38:43 -07:00
2010-03-30 22:02:32 +09:00
2010-04-08 09:46:19 +09:30
2010-03-30 22:02:32 +09:00
2010-03-19 07:17:52 -07:00
2010-02-09 11:13:56 +01:00