Skip to content

Commit

Permalink
um: winch_interrupt() can happen inside of free_winch()
Browse files Browse the repository at this point in the history
...  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 <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Al Viro authored and torvalds committed Sep 15, 2011
1 parent f71f948 commit 45cd5e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/um/drivers/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,17 @@ 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);

list_del(&winch->list);

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);
Expand Down

0 comments on commit 45cd5e2

Please sign in to comment.