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

Next file: linux/drivers/net/sis900.c
Previous file: linux/drivers/net/sbni.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/sdla.c linux/drivers/net/sdla.c
@@ -1218,7 +1218,10 @@
 			return(-ENOMEM);
 		sdla_read(dev, mem.addr, temp, mem.len);
 		if(copy_to_user(mem.data, temp, mem.len))
+		{
+			kfree(temp);
 			return -EFAULT;
+		}
 		kfree(temp);
 	}
 	else
@@ -1227,7 +1230,10 @@
 		if (!temp)
 			return(-ENOMEM);
 		if(copy_from_user(temp, mem.data, mem.len))
+		{
+			kfree(temp);
 			return -EFAULT;
+		}
 		sdla_write(dev, mem.addr, temp, mem.len);
 		kfree(temp);
 	}

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