linux-mips
[Top] [All Lists]

Re: "eth%d" - net dev name in 2.6?

To: Jun Sun <jsun@mvista.com>
Subject: Re: "eth%d" - net dev name in 2.6?
From: Ralf Baechle <ralf@linux-mips.org>
Date: Wed, 10 Mar 2004 15:51:57 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <20040310023308.GU31326@mvista.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20040310023308.GU31326@mvista.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.1i
On Tue, Mar 09, 2004 at 06:33:08PM -0800, Jun Sun wrote:

> With swarm running on 2.6 I just saw the net dev names are
> not set correctly.  See below.
> 
> eth%d: SiByte Ethernet at 0x10064000, address: 00-02-4C-FE-0C-B2              
>   
> eth%d: enabling TCP rcv checksum                                              
>   
> 
> It appears alloc_netdev() assigns this initial name and nobody
> later resets it to a more meaningful name.  
> 
> Any body has a clue here?  I don't think it is driver's job though ...

It's always the driver :-)

It's referencing net_device->name before register_netdev.

There's plenty of other small candy in that driver, for example in
sbmac_cleanup_module():

                dev = dev_sbmac[idx];
                if (!dev) {
                        struct sbmac_softc *sc = dev->priv;
                        unregister_netdev(dev);
                        sbmac_uninitctx(sc);
                        free_netdev(dev);
                }

Better make sure the pointer is NULL before we dereference it.  We don't
want to miss a crash, do we ;-)

  Ralf

<Prev in Thread] Current Thread [Next in Thread>