]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix netpoll cleanup on abort without dev
authorMatt Mackall <mpm@selenic.com>
Mon, 23 Aug 2004 06:05:13 +0000 (23:05 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 23 Aug 2004 06:05:13 +0000 (23:05 -0700)
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>
net/core/netpoll.c

index daac168875a3d310dde97f8b4be2d48fcb705dc5..ec4dea2d7f7ea9d458c254dc134e3438e472e3a7 100644 (file)
@@ -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);
        }