Hi,

I was testing the sis190 driver and got an oops. Tests show that the error
path is the following  : 

sis190_init_one()
 -> register_netdev
   * Userspace sees the new interface and run ethtool ethX.
   * ethtool calls ethtools_get_settings
   * ethtools_get_settings try to access to the mii datas
   * oops occurs
 -> sis190_mii_probe 

The fix I made is to replace the sequence by the following one : 

sis190_init_one()
 -> sis190_mii_probe
 -> register_netdev



Regards,
Arnaud Patard


Signed-off-by: Arnaud Patard <[EMAIL PROTECTED]>

diff -rpuN a/drivers/net/sis190.c b/drivers/net/sis190.c
--- a/drivers/net/sis190.c	2005-08-25 15:36:24.000000000 +0200
+++ b/drivers/net/sis190.c	2005-08-25 15:36:34.000000000 +0200
@@ -1779,14 +1779,18 @@ static int __devinit sis190_init_one(str
 	dev->irq = pdev->irq;
 	dev->base_addr = (unsigned long) 0xdead;
 
+	pci_set_drvdata(pdev, dev);
+
 	spin_lock_init(&tp->lock);
+	rc = sis190_mii_probe(dev);
+	if (rc < 0)
+		goto err_release_board;
+
 	rc = register_netdev(dev);
 	if (rc < 0)
 		goto err_release_board;
 
-	pci_set_drvdata(pdev, dev);
 
-	rc = sis190_mii_probe(dev);
 	if (rc < 0)
 		goto err_unregister_dev;
 

Reply via email to