patch-2.3.22 linux/drivers/net/wan/sbni.c

Next file: linux/drivers/parport/Config.in
Previous file: linux/drivers/net/wan/cycx_x25.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.21/linux/drivers/net/wan/sbni.c linux/drivers/net/wan/sbni.c
@@ -1280,10 +1280,12 @@
 				return -EPERM;
 			if(copy_from_user( tmpstr, ifr->ifr_data, 6))
 				return -EFAULT;
-			slave=dev_get(tmpstr);
+			slave = dev_get_by_name(tmpstr);
 			if(!(slave && slave->flags & IFF_UP && dev->flags & IFF_UP))
 			{
 				printk("%s: Both devices should be UP to enslave!\n",dev->name);
+				if (slave)
+					dev_put(slave);
 				return -EINVAL;
 			}
 		
@@ -1304,8 +1306,9 @@
 				else
 				{
 					printk("%s: one of devices is already slave!\n",dev->name);
-					return -EBUSY;
+					error = -EBUSY;
 				}
+				dev_put(slave);
 			}
 			else
 			{
@@ -1359,7 +1362,7 @@
 
 unsigned long calc_crc(char *mem, int len, unsigned initial)
 {
-   
+	unsigned crc, dummy_len;
 	__asm__ (
 		"xorl %%eax,%%eax\n\t"
 		"1:\n\t"
@@ -1367,13 +1370,12 @@
 		"xorb %%dl,%%al\n\t"
 		"shrl $8,%%edx\n\t"
 		"xorl (%%edi,%%eax,4),%%edx\n\t"
-		"loop 1b\n\t"
-		"movl %%edx,%%eax"
-		: 
-		: "S" (mem), "D" (&crc32tab[0]), "c" (len), "d" (initial)
-		: "eax", "edx", "ecx"
+		"loop 1b"
+		: "=d" (crc), "=c" (dummy_len)
+		: "S" (mem), "D" (&crc32tab[0]), "1" (len), "0" (initial)
+		: "eax"
 	);
-	/* return crc; */
+	return crc;
 }
 
 #else

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