diff options
| author | Amit Shah <[email protected]> | 2010-03-12 06:23:15 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2010-03-19 14:17:54 +0000 |
| commit | e74d098c66543d0731de62eb747ccd5b636a6f4c (patch) | |
| tree | 8ed9937f653cf42a82ca7bd319a69dd35fb2325d /lib/debugobjects.c | |
| parent | uartlite: Fix build on sparc. (diff) | |
| download | kernel-e74d098c66543d0731de62eb747ccd5b636a6f4c.tar.gz kernel-e74d098c66543d0731de62eb747ccd5b636a6f4c.zip | |
hvc_console: Fix race between hvc_close and hvc_remove
Alan pointed out a race in the code where hvc_remove is invoked. The
recent virtio_console work is the first user of hvc_remove().
Alan describes it thus:
The hvc_console assumes that a close and remove call can't occur at the
same time.
In addition tty_hangup(tty) is problematic as tty_hangup is asynchronous
itself....
So this can happen
hvc_close hvc_remove
hung up ? - no
lock
tty = hp->tty
unlock
lock
hp->tty = NULL
unlock
notify del
kref_put the hvc struct
close completes
tty is destroyed
tty_hangup dead tty
tty->ops will be NULL
NULL->...
This patch adds some tty krefs and also converts to using tty_vhangup().
Reported-by: Alan Cox <[email protected]>
Signed-off-by: Amit Shah <[email protected]>
CC: Alan Cox <[email protected]>
CC: [email protected]
CC: Rusty Russell <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions
