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

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)