patch-2.4.0-test8 linux/net/atm/mpoa_proc.c

Next file: linux/net/ax25/af_ax25.c
Previous file: linux/mm/vmscan.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test7/linux/net/atm/mpoa_proc.c linux/net/atm/mpoa_proc.c
@@ -155,7 +155,10 @@
 	if (*pos >= length) length = 0;
 	else {
 	  if ((count + *pos) > length) count = length - *pos;
-	  copy_to_user(buff, (char *)page , count);
+	  if (copy_to_user(buff, (char *)page , count)) {
+ 		  free_page(page);
+		  return -EFAULT;
+          }
 	  *pos += count;
 	}
 
@@ -198,7 +201,7 @@
         *ppos += incoming;
 
         page[incoming] = '\0';
-	retval = parse_qos(buff, incoming);
+	retval = parse_qos(page, incoming);
         if (retval == 0)
                 printk("mpoa: proc_mpc_write: could not parse '%s'\n", page);
 

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