提交 45cd5e2d 编写于 作者: A Al Viro 提交者: Linus Torvalds

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: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NRichard Weinberger <richard@nod.at>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f71f9484
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册