]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - net/ax25/af_ax25.c
ax25: Fix possible oops in ax25_make_new
[linux-2.6.git] / net / ax25 / af_ax25.c
index cd1c3dc0fe0148367412c18265f308090eba972b..f454607303717d2f1339cfd901e6b2ae5ec8437f 100644 (file)
@@ -901,7 +901,6 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev)
 
        sock_init_data(NULL, sk);
 
-       sk->sk_destruct = ax25_free_sock;
        sk->sk_type     = osk->sk_type;
        sk->sk_priority = osk->sk_priority;
        sk->sk_protocol = osk->sk_protocol;
@@ -939,6 +938,7 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev)
        }
 
        sk->sk_protinfo = ax25;
+       sk->sk_destruct = ax25_free_sock;
        ax25->sk    = sk;
 
        return sk;