From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Thu, 10 Aug 2006 16:52:16 -0700
> Dave, here is my version...
> Don't leak memory on interrupted read. And only allocate
> as much memory as needed.
>
> Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
I think I'm going to go with James's safe original fix
for now, thanks.
commit a7fc5b24a4921a6582ce47c0faf3a31858a80468
Author: David S. Miller <[EMAIL PROTECTED]>
Date: Thu Aug 10 16:53:33 2006 -0700
[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 <[EMAIL PROTECTED]>
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index b343532..dab37d2 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -130,11 +130,12 @@ static ssize_t tcpprobe_read(struct file
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;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html