Skip to content

Commit

Permalink
[TCP]: Fix botched memory leak fix to tcpprobe_read().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Aug 14, 2006
1 parent f54fa84 commit 18b6fe6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/tcp_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 18b6fe6

Please sign in to comment.