Re: Oops after register_netdev() failure in 2.6.3-bk5

From: viro
Date: Tue Feb 24 2004 - 17:41:15 EST


On Tue, Feb 24, 2004 at 04:36:10PM -0500, Pavel Roskin wrote:

> I won't do it for now. In the long term, I believe it's a legitimate
> approach to register a network device with carrier off and set it to on
> only if the carrier has been detected by the hardware.
>
> Maybe linkwatch_fire_event() should do nothing in certain situations?
> Following patch fixes the crash. I didn't put much thought into the
> patch, perhaps it could be improved.
>
> ==================================
> --- net/core/link_watch.c
> +++ net/core/link_watch.c
> @@ -102,6 +102,9 @@ static void linkwatch_event(void *dummy)
>
> void linkwatch_fire_event(struct net_device *dev)
> {
> + if (dev->reg_state == NETREG_UNINITIALIZED)
> + return;
> +
> if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) {
> unsigned long flags;
> struct lw_event *event;
> ==================================

Makes sense, as far as I can see. However, I'd like to hear an ACK from
jgarzik and davem first.
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html