aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-25 15:28:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-25 15:28:28 -0400
commit2e561c7b7e705b619122e5386d6f99f28f2b6e5a (patch)
treebe942c58cacd25c66cced37e1a82f269c37871de /net/ipv4
parent2cfed60cc24676d65e01278dbf10d0069de02592 (diff)
parent653252c2302cdf2dfbca66a7e177f7db783f9efa (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (48 commits) net: Fix wrong interpretation of some copy_to_user() results. xfrm: alg_key_len & alg_icv_len should be unsigned [netdrvr] tehuti: move ioctl perm check closer to function start ipv6: Fix typo in net/ipv6/Kconfig via-velocity: fix vlan receipt tg3: sparse cleanup forcedeth: realtek phy crossover detection ibm_newemac: Increase MDIO timeouts gianfar: Fix skb allocation strategy netxen: reduce stack usage of netxen_nic_flash_print smc911x: test after postfix decrement fails in smc911x_{reset,drop_pkt} net drivers: fix platform driver hotplug/coldplug forcedeth: new backoff implementation ehea: make things static phylib: Add support for board-level PHY fixups [netdrvr] atlx: code movement: move atl1 parameter parsing atlx: remove flash vendor parameter korina: misc cleanup korina: fix misplaced return statement WAN: Fix confusing insmod error code for C101 too. ...
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_probe.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 1c509592574a..5ff0ce6e9d39 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -190,19 +190,18 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf,
190 190
191 width = tcpprobe_sprint(tbuf, sizeof(tbuf)); 191 width = tcpprobe_sprint(tbuf, sizeof(tbuf));
192 192
193 if (width < len) 193 if (cnt + width < len)
194 tcp_probe.tail = (tcp_probe.tail + 1) % bufsize; 194 tcp_probe.tail = (tcp_probe.tail + 1) % bufsize;
195 195
196 spin_unlock_bh(&tcp_probe.lock); 196 spin_unlock_bh(&tcp_probe.lock);
197 197
198 /* if record greater than space available 198 /* if record greater than space available
199 return partial buffer (so far) */ 199 return partial buffer (so far) */
200 if (width >= len) 200 if (cnt + width >= len)
201 break; 201 break;
202 202
203 error = copy_to_user(buf + cnt, tbuf, width); 203 if (copy_to_user(buf + cnt, tbuf, width))
204 if (error) 204 return -EFAULT;
205 break;
206 cnt += width; 205 cnt += width;
207 } 206 }
208 207