[TCP]: Fix botched memory leak fix to tcpprobe_read().
authorDavid S. Miller <davem@davemloft.net>
Mon, 14 Aug 2006 01:05:09 +0000 (18:05 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Aug 2006 01:05:09 +0000 (18:05 -0700)
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>
net/ipv4/tcp_probe.c

index b3435324b573fb468f429bb3db805158d8aac2ae..dab37d2f65fcf09a820bce52300d7f335ab5066c 100644 (file)
@@ -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;