summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp_probe.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2006-08-14 05:05:09 +0400
committerDavid S. Miller <davem@davemloft.net>2006-08-14 05:05:09 +0400
commit18b6fe64d4d1f6e0a2c71429a5e5074f43e29203 (patch)
tree32d7c7f7a3fc82c5478f129f52105c1c020df75a /net/ipv4/tcp_probe.c
parentf54fa84dda211f68f65002efa44142207c886c79 (diff)
downloadlinux-18b6fe64d4d1f6e0a2c71429a5e5074f43e29203.tar.xz
[TCP]: Fix botched memory leak fix to tcpprobe_read().
Somehow I clobbered James's original fix and only my subsequent compiler warning change went in for that changeset. Get the real fix in there. Noticed by Jesper Juhl. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_probe.c')
-rw-r--r--net/ipv4/tcp_probe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index b3435324b573..dab37d2f65fc 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -130,11 +130,12 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf,
error = wait_event_interruptible(tcpw.wait,
__kfifo_len(tcpw.fifo) != 0);
if (error)
- return error;
+ goto out_free;
cnt = kfifo_get(tcpw.fifo, tbuf, len);
error = copy_to_user(buf, tbuf, cnt);
+out_free:
vfree(tbuf);
return error ? error : cnt;