patch-2.4.21 linux-2.4.21/net/8021q/vlanproc.c

Next file: linux-2.4.21/net/atm/atm_misc.c
Previous file: linux-2.4.21/net/8021q/vlan_dev.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/net/8021q/vlanproc.c linux-2.4.21/net/8021q/vlanproc.c
@@ -252,8 +252,10 @@
 	offs = file->f_pos;
 	if (offs < pos) {
 		len = min_t(int, 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)