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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux