From 45f3b6f6f801a552675e9b74784ccc48865cec96 Mon Sep 17 00:00:00 2001 From: Tom Quetchenbach Date: Thu, 24 Apr 2008 21:11:58 -0700 Subject: [PATCH] --- yaml --- r: 93086 b: refs/heads/master c: 8d390efd903485923419584275fd0c2aa4c94183 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/ipv4/tcp_probe.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 62fc43fd35ad..a0f087208cd0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5d6ab56daa439d681aab29955498486e452224d +refs/heads/master: 8d390efd903485923419584275fd0c2aa4c94183 diff --git a/trunk/net/ipv4/tcp_probe.c b/trunk/net/ipv4/tcp_probe.c index 1c509592574a..5ff0ce6e9d39 100644 --- a/trunk/net/ipv4/tcp_probe.c +++ b/trunk/net/ipv4/tcp_probe.c @@ -190,19 +190,18 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf, width = tcpprobe_sprint(tbuf, sizeof(tbuf)); - if (width < len) + if (cnt + width < len) tcp_probe.tail = (tcp_probe.tail + 1) % bufsize; spin_unlock_bh(&tcp_probe.lock); /* if record greater than space available return partial buffer (so far) */ - if (width >= len) + if (cnt + width >= len) break; - error = copy_to_user(buf + cnt, tbuf, width); - if (error) - break; + if (copy_to_user(buf + cnt, tbuf, width)) + return -EFAULT; cnt += width; }