diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2011-09-15 01:21:28 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-15 03:09:37 +0200 |
commit | 45cd5e2d4e632f55af1d6131f33b554c98f8b929 (patch) | |
tree | 8cc6c469235826606383420663d16e29fbdc4cbd /arch/um/drivers | |
parent | um: fix oopsable race in line_close() (diff) | |
download | linux-45cd5e2d4e632f55af1d6131f33b554c98f8b929.tar.xz linux-45cd5e2d4e632f55af1d6131f33b554c98f8b929.zip |
um: winch_interrupt() can happen inside of free_winch()
... so set winch->fd to -1 before doing free_irq(), to avoid having
winch_interrupt() come from/during the latter and attempt to do
reactivate_fd() on something that's already gone.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r-- | arch/um/drivers/line.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index c5bff1ddeabc..91bf18941ca4 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -725,6 +725,8 @@ struct winch { static void free_winch(struct winch *winch, int free_irq_ok) { + int fd = winch->fd; + winch->fd = -1; if (free_irq_ok) free_irq(WINCH_IRQ, winch); @@ -732,8 +734,8 @@ static void free_winch(struct winch *winch, int free_irq_ok) if (winch->pid != -1) os_kill_process(winch->pid, 1); - if (winch->fd != -1) - os_close_file(winch->fd); + if (fd != -1) + os_close_file(fd); if (winch->stack != 0) free_stack(winch->stack, 0); kfree(winch); |