[Top] [All Lists]

Re: [BUG] drivers/net/ioc3_eth.c in 2.5

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: Re: [BUG] drivers/net/ioc3_eth.c in 2.5
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Mon, 9 Jun 2003 10:10:18 -0700
Cc: ralf@xxxxxxxxxxx, jgarzik@xxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20030607.013010.116359540.davem@xxxxxxxxxx>
Organization: Open Source Development Lab
References: <20030606161658.1f01b8f9.shemminger@xxxxxxxx> <20030607.013010.116359540.davem@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Sat, 07 Jun 2003 01:30:10 -0700 (PDT)
"David S. Miller" <davem@xxxxxxxxxx> wrote:

>    From: Stephen Hemminger <shemminger@xxxxxxxx>
>    Date: Fri, 6 Jun 2003 16:16:58 -0700
>    This driver never calls unregister in it's module exit function:
>    static void __exit ioc3_cleanup_module(void)
>    {
>       pci_unregister_driver(&ioc3_driver);
>    }
> pci_unregister_driver() invokes, for each PCI driver instance
> registered, the ->remove() method for that driver.
> What is the problem?  tg3.c and many other drivers work exactly
> like this, using the PCI registry mechanism as a helper to do
> all the grunge work or device iteration.

pci_unregister_driver does the iteration but not the net device

The problem is the driver never calls unregister_netdev, it just free's
the device structure.  If this ever happens, the net device list would be 
Don't have the hardware to actually do this though.

Looks like the right fix is:
--- ioc3-eth.c.orig     2003-06-09 10:05:45.000000000 -0700
+++ ioc3-eth.c  2003-06-09 10:04:45.000000000 -0700
@@ -1614,6 +1614,7 @@ static void __devexit ioc3_remove_one (s
        struct ioc3 *ioc3 = ip->regs;
+       unregister_netdev(dev);

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