From: David S. Miller Date: Mon, 14 Aug 2006 01:05:09 +0000 (-0700) Subject: [TCP]: Fix botched memory leak fix to tcpprobe_read(). X-Git-Tag: v2.6.18-rc5~103 X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=18b6fe64d4d1f6e0a2c71429a5e5074f43e29203;p=~andy%2Flinux [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 --- diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c index b3435324b57..dab37d2f65f 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;