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>
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);
}