aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Mackall <mpm@selenic.com>2004-08-22 23:05:13 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 23:05:13 -0700
commit6e354f5cececd74a72c4f11bc5758cebbc7395d1 (patch)
treeb4e0af467d4a2bd7f45892ce11d6c5c1b9a77e07
parent579aa5b4517cf0b3b4288567de6dfc7c5df081dd (diff)
downloadhistory-6e354f5cececd74a72c4f11bc5758cebbc7395d1.tar.gz
[PATCH] Fix netpoll cleanup on abort without dev
If netpoll attempts to use a device without polling support, it will oops when shutting down. This adds a check that we've actually attached to a device. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--net/core/netpoll.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index daac168875a3d..ec4dea2d7f7ea 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -614,7 +614,8 @@ void netpoll_cleanup(struct netpoll *np)
spin_lock_irqsave(&rx_list_lock, flags);
list_del(&np->rx_list);
#ifdef CONFIG_NETPOLL_RX
- np->dev->netpoll_rx = 0;
+ if (np->dev)
+ np->dev->netpoll_rx = 0;
#endif
spin_unlock_irqrestore(&rx_list_lock, flags);
}