patch-2.4.6 linux/net/wanrouter/wanproc.c
Next file: linux/net/x25/x25_link.c
Previous file: linux/net/wanrouter/wanmain.c
Back to the patch index
Back to the overall index
-  Lines: 12
-  Date:
Wed Jun 27 17:10:55 2001
-  Orig file: 
v2.4.5/linux/net/wanrouter/wanproc.c
-  Orig date: 
Thu May 24 15:01:02 2001
diff -u --recursive --new-file v2.4.5/linux/net/wanrouter/wanproc.c linux/net/wanrouter/wanproc.c
@@ -813,8 +813,10 @@
 		offs = file->f_pos;
 		if (offs < pos) {
 			len = min(pos - offs, count);
-			if(copy_to_user(buf, (page + offs), len))
+			if (copy_to_user(buf, (page + offs), len)) {
+				kfree(page);
 				return -EFAULT;
+			}
 			file->f_pos += len;
 		}
 		else
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)