fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / ax25 / ax25_out.c
index d7736e5..f84047d 100644 (file)
@@ -70,11 +70,11 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, ax25_address *src, ax2
        ax25->dest_addr   = *dest;
 
        if (digi != NULL) {
-               if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
+               ax25->digipeat = kmemdup(digi, sizeof(*digi), GFP_ATOMIC);
+               if (ax25->digipeat == NULL) {
                        ax25_cb_put(ax25);
                        return NULL;
                }
-               memcpy(ax25->digipeat, digi, sizeof(ax25_digi));
        }
 
        switch (ax25->ax25_dev->values[AX25_VALUES_PROTOCOL]) {