* [PATCH] Fix netpoll cleanup on abort without dev
@ 2004-08-04 14:20 Matt Mackall
2004-08-04 14:54 ` Jeff Moyer
0 siblings, 1 reply; 3+ messages in thread
From: Matt Mackall @ 2004-08-04 14:20 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
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>
Index: np/net/core/netpoll.c
===================================================================
--- np.orig/net/core/netpoll.c 2004-08-04 08:50:56.000000000 -0500
+++ np/net/core/netpoll.c 2004-08-04 09:02:50.000000000 -0500
@@ -614,7 +614,8 @@
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);
}
--
Mathematics is the supreme nostalgia of our time.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix netpoll cleanup on abort without dev
2004-08-04 14:20 [PATCH] Fix netpoll cleanup on abort without dev Matt Mackall
@ 2004-08-04 14:54 ` Jeff Moyer
2004-08-04 15:11 ` Matt Mackall
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Moyer @ 2004-08-04 14:54 UTC (permalink / raw)
To: Matt Mackall; +Cc: linux-kernel, Andrew Morton
==> Regarding [PATCH] Fix netpoll cleanup on abort without dev; Matt Mackall <mpm@selenic.com> adds:
mpm> If netpoll attempts to use a device without polling support, it will
mpm> oops when shutting down. This adds a check that we've actually
mpm> attached to a device.
Hi, Matt,
Perhaps I'm missing something, but how do we successfully return from
netpoll_setup without np->dev filled in? Netpoll_setup has the following:
if (!ndev->poll_controller) {
printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n",
np->name, np->dev_name);
goto release;
}
Thanks,
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix netpoll cleanup on abort without dev
2004-08-04 14:54 ` Jeff Moyer
@ 2004-08-04 15:11 ` Matt Mackall
0 siblings, 0 replies; 3+ messages in thread
From: Matt Mackall @ 2004-08-04 15:11 UTC (permalink / raw)
To: Jeff Moyer; +Cc: linux-kernel, Andrew Morton
On Wed, Aug 04, 2004 at 10:54:01AM -0400, Jeff Moyer wrote:
> ==> Regarding [PATCH] Fix netpoll cleanup on abort without dev; Matt Mackall <mpm@selenic.com> adds:
>
> mpm> If netpoll attempts to use a device without polling support, it will
> mpm> oops when shutting down. This adds a check that we've actually
> mpm> attached to a device.
>
> Hi, Matt,
>
> Perhaps I'm missing something, but how do we successfully return from
> netpoll_setup without np->dev filled in? Netpoll_setup has the following:
>
> if (!ndev->poll_controller) {
> printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n",
> np->name, np->dev_name);
> goto release;
> }
We don't. What happens is netconsole is blindly calling
netpoll_cleanup on module exit. I could move the np->dev check up to
that point, but it seems to me that netpoll_cleanup should be made
harmless instead.
ps: you still owe me a netpoll patch
--
Mathematics is the supreme nostalgia of our time.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-08-04 15:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-04 14:20 [PATCH] Fix netpoll cleanup on abort without dev Matt Mackall
2004-08-04 14:54 ` Jeff Moyer
2004-08-04 15:11 ` Matt Mackall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®