Commit 6e354f5c authored by Matt Mackall's avatar Matt Mackall Committed by Linus Torvalds

[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: default avatarMatt Mackall <mpm@selenic.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 579aa5b4
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment