patch-2.2.18 linux/drivers/net/sbni.c

Next file: linux/drivers/net/sdla.c
Previous file: linux/drivers/net/rtl8139.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/net/sbni.c linux/drivers/net/sbni.c
@@ -342,7 +342,7 @@
 	if(base_addr > 0x1ff)	/* Check a single specified location. */
 		return sbni_probe1(dev, base_addr);
 	else if(base_addr != 0)	/* Don't probe at all. */
-		return ENXIO;
+		return -ENXIO;
 	for(i = 0; (base_addr = netcard_portlist[i]); i++)
 	{ 
 		if(!check_region(base_addr, SBNI_IO_EXTENT) && base_addr != 1)
@@ -353,7 +353,7 @@
 				return 0;
 		}
 	}
-	return ENODEV;
+	return -ENODEV;
 }
 
 #endif /* have devlist*/
@@ -416,7 +416,7 @@
 	}
 
 	if(bad_card)
-		return ENODEV;
+		return -ENODEV;
 	else
 		outb(0, ioaddr + CSR0); 
 	if(dev->irq < 2)
@@ -429,8 +429,8 @@
 
 		if(autoirq == 0)
 		{
-			printk("sbni probe at %#x failed to detect IRQ line\n", ioaddr);
-			return EAGAIN;
+			printk(KERN_ERR "sbni probe at %#x failed to detect IRQ line\n", ioaddr);
+			return -EAGAIN;
 		}
 	}
 	/* clear FIFO buffer */
@@ -444,7 +444,7 @@
 		if (irqval) 
 		{
 			printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval);
-			return EAGAIN;
+			return -EAGAIN;
 		}
 	}
      
@@ -456,6 +456,7 @@
 	if(dev->priv == NULL)
 	{
 		DP( printk("%s: cannot allocate memory\n", dev->name); )
+		free_irq(dev->irq, dev);
 		return -ENOMEM;
 	}
    

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)