fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / ax25 / af_ax25.c
index 000695c..42233df 100644 (file)
@@ -906,13 +906,13 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev)
        ax25->source_addr = oax25->source_addr;
 
        if (oax25->digipeat != NULL) {
-               if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
+               ax25->digipeat = kmemdup(oax25->digipeat, sizeof(ax25_digi),
+                                        GFP_ATOMIC);
+               if (ax25->digipeat == NULL) {
                        sk_free(sk);
                        ax25_cb_put(ax25);
                        return NULL;
                }
-
-               memcpy(ax25->digipeat, oax25->digipeat, sizeof(ax25_digi));
        }
 
        sk->sk_protinfo = ax25;
@@ -1088,8 +1088,8 @@ out:
 /*
  *     FIXME: nonblock behaviour looks like it may have a bug.
  */
-static int ax25_connect(struct socket *sock, struct sockaddr *uaddr,
-       int addr_len, int flags)
+static int __must_check ax25_connect(struct socket *sock,
+       struct sockaddr *uaddr, int addr_len, int flags)
 {
        struct sock *sk = sock->sk;
        ax25_cb *ax25 = ax25_sk(sk), *ax25t;