提交 8d93c700 编写于 作者: J Jeff Dike 提交者: Linus Torvalds

[PATCH] uml: free network IRQ correctly

Free the network IRQ when closing down the network devices at shutdown.
Delete the device from the opened devices list on close.

These prevent an -EBADF when later disabling SIGIO on all extant descriptors
and a complaint from free_irq about freeing the IRQ twice.
Signed-off-by: NJeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3a331a51
...@@ -150,6 +150,7 @@ static int uml_net_close(struct net_device *dev) ...@@ -150,6 +150,7 @@ static int uml_net_close(struct net_device *dev)
if(lp->close != NULL) if(lp->close != NULL)
(*lp->close)(lp->fd, &lp->user); (*lp->close)(lp->fd, &lp->user);
lp->fd = -1; lp->fd = -1;
list_del(&lp->list);
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
return 0; return 0;
...@@ -715,6 +716,7 @@ static void close_devices(void) ...@@ -715,6 +716,7 @@ static void close_devices(void)
list_for_each(ele, &opened){ list_for_each(ele, &opened){
lp = list_entry(ele, struct uml_net_private, list); lp = list_entry(ele, struct uml_net_private, list);
free_irq(lp->dev->irq, lp->dev);
if((lp->close != NULL) && (lp->fd >= 0)) if((lp->close != NULL) && (lp->fd >= 0))
(*lp->close)(lp->fd, &lp->user); (*lp->close)(lp->fd, &lp->user);
if(lp->remove != NULL) (*lp->remove)(&lp->user); if(lp->remove != NULL) (*lp->remove)(&lp->user);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册