aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/line.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2011-09-14 19:21:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-09-14 21:09:37 -0400
commit45cd5e2d4e632f55af1d6131f33b554c98f8b929 (patch)
tree8cc6c469235826606383420663d16e29fbdc4cbd /arch/um/drivers/line.c
parentf71f94845e0126884eca8ce57a92e30b189c8e71 (diff)
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/line.c')
-rw-r--r--arch/um/drivers/line.c6
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 {
725 725
726static void free_winch(struct winch *winch, int free_irq_ok) 726static void free_winch(struct winch *winch, int free_irq_ok)
727{ 727{
728 int fd = winch->fd;
729 winch->fd = -1;
728 if (free_irq_ok) 730 if (free_irq_ok)
729 free_irq(WINCH_IRQ, winch); 731 free_irq(WINCH_IRQ, winch);
730 732
@@ -732,8 +734,8 @@ static void free_winch(struct winch *winch, int free_irq_ok)
732 734
733 if (winch->pid != -1) 735 if (winch->pid != -1)
734 os_kill_process(winch->pid, 1); 736 os_kill_process(winch->pid, 1);
735 if (winch->fd != -1) 737 if (fd != -1)
736 os_close_file(winch->fd); 738 os_close_file(fd);
737 if (winch->stack != 0) 739 if (winch->stack != 0)
738 free_stack(winch->stack, 0); 740 free_stack(winch->stack, 0);
739 kfree(winch); 741 kfree(winch);