]> err.no Git - linux-2.6/blobdiff - net/wanrouter/af_wanpipe.c
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6] / net / wanrouter / af_wanpipe.c
index d93b19faaab7f9b4b1e3fee8caa0975aae9b3eaa..7a43ae4721edd95fd6748974f68b8cf40c2f5e7b 100644 (file)
@@ -57,7 +57,7 @@
 #include <linux/wanpipe.h>
 #include <linux/if_wanpipe.h>
 #include <linux/pkt_sched.h>
-#include <linux/tcp.h>
+#include <linux/tcp_states.h>
 #include <linux/if_wanpipe_common.h>
 #include <linux/sdla_x25.h>
 
@@ -181,7 +181,7 @@ struct wanpipe_opt
 #endif
 
 static int sk_count;
-extern struct proto_ops wanpipe_ops;
+extern const struct proto_ops wanpipe_ops;
 static unsigned long find_free_critical;
 
 static void wanpipe_unlink_driver(struct sock *sk);
@@ -1099,7 +1099,7 @@ static void release_driver(struct sock *sk)
        sock_reset_flag(sk, SOCK_ZAPPED);
        wp = wp_sk(sk);
 
-       if (wp && wp->mbox) {
+       if (wp) {
                kfree(wp->mbox);
                wp->mbox = NULL;
        }
@@ -1186,10 +1186,8 @@ static void wanpipe_kill_sock_timer (unsigned long data)
                return;
        }
 
-       if (wp_sk(sk)) {
-               kfree(wp_sk(sk));
-               wp_sk(sk) = NULL;
-       }
+       kfree(wp_sk(sk));
+       wp_sk(sk) = NULL;
 
        if (atomic_read(&sk->sk_refcnt) != 1) {
                atomic_set(&sk->sk_refcnt, 1);
@@ -1219,10 +1217,8 @@ static void wanpipe_kill_sock_accept (struct sock *sk)
        sk->sk_socket = NULL;
 
 
-       if (wp_sk(sk)) {
-               kfree(wp_sk(sk));
-               wp_sk(sk) = NULL;
-       }
+       kfree(wp_sk(sk));
+       wp_sk(sk) = NULL;
 
        if (atomic_read(&sk->sk_refcnt) != 1) {
                atomic_set(&sk->sk_refcnt, 1);
@@ -1243,10 +1239,8 @@ static void wanpipe_kill_sock_irq (struct sock *sk)
 
        sk->sk_socket = NULL;
 
-       if (wp_sk(sk)) {
-               kfree(wp_sk(sk));
-               wp_sk(sk) = NULL;
-       }
+       kfree(wp_sk(sk));
+       wp_sk(sk) = NULL;
 
        if (atomic_read(&sk->sk_refcnt) != 1) {
                atomic_set(&sk->sk_refcnt, 1);
@@ -1845,7 +1839,7 @@ static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long ar
 #endif
 
                default:
-                       return dev_ioctl(cmd,(void __user *) arg);
+                       return -ENOIOCTLCMD;
        }
        /*NOTREACHED*/
 }
@@ -2552,7 +2546,7 @@ static int wanpipe_connect(struct socket *sock, struct sockaddr *uaddr, int addr
        return 0;
 }
 
-struct proto_ops wanpipe_ops = {
+const struct proto_ops wanpipe_ops = {
        .family =       PF_WANPIPE,
        .owner =        THIS_MODULE,
        .release =      wanpipe_release,