]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/tcp_probe.c
[DCCP] ackvec: Split long ack vectors across multiple options
[linux-2.6-omap-h63xx.git] / net / ipv4 / tcp_probe.c
index d7d517a3a238b918862896e114e3ea0261f5652c..f230eeecf09289eaabcb6125af5129ae0fb57cc0 100644 (file)
@@ -99,8 +99,10 @@ static int jtcp_sendmsg(struct kiocb *iocb, struct sock *sk,
 }
 
 static struct jprobe tcp_send_probe = {
-       .kp = { .addr = (kprobe_opcode_t *) &tcp_sendmsg, },
-       .entry = (kprobe_opcode_t *) &jtcp_sendmsg,
+       .kp = {
+               .symbol_name    = "tcp_sendmsg",
+       },
+       .entry  = JPROBE_ENTRY(jtcp_sendmsg),
 };
 
 
@@ -114,7 +116,7 @@ static int tcpprobe_open(struct inode * inode, struct file * file)
 static ssize_t tcpprobe_read(struct file *file, char __user *buf,
                             size_t len, loff_t *ppos)
 {
-       int error = 0, cnt;
+       int error = 0, cnt = 0;
        unsigned char *tbuf;
 
        if (!buf || len < 0)
@@ -130,11 +132,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;
@@ -153,6 +156,8 @@ static __init int tcpprobe_init(void)
        init_waitqueue_head(&tcpw.wait);
        spin_lock_init(&tcpw.lock);
        tcpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &tcpw.lock);
+       if (IS_ERR(tcpw.fifo))
+               return PTR_ERR(tcpw.fifo);
 
        if (!proc_net_fops_create(procname, S_IRUSR, &tcpprobe_fops))
                goto err0;