patch-2.4.27 linux-2.4.27/net/atm/br2684.c

Next file: linux-2.4.27/net/atm/lec.c
Previous file: linux-2.4.27/net/Makefile
Back to the patch index
Back to the overall index

diff -urN linux-2.4.26/net/atm/br2684.c linux-2.4.27/net/atm/br2684.c
@@ -736,6 +736,8 @@
 {
 	unsigned long page;
 	int len = 0, x, left;
+	loff_t n = *pos;
+
 	page = get_free_page(GFP_KERNEL);
 	if (!page)
 		return -ENOMEM;
@@ -744,7 +746,7 @@
 		left = count;
 	read_lock(&devs_lock);
 	for (;;) {
-		x = br2684_proc_engine(*pos, &((char *) page)[len]);
+		x = br2684_proc_engine(n, &((char *) page)[len]);
 		if (x == 0)
 			break;
 		if (x > left)
@@ -759,11 +761,12 @@
 		}
 		len += x;
 		left -= x;
-		(*pos)++;
+		n++;
 		if (left < 256)
 			break;
 	}
 	read_unlock(&devs_lock);
+	*pos = n;
 	if (len > 0 && copy_to_user(buf, (char *) page, len))
 		len = -EFAULT;
 	free_page(page);

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