Pull platform-drivers into test branch
[sfrench/cifs-2.6.git] / net / ax25 / ax25_route.c
index 51b7bdaf27eb4877d0155b55b0a749a1f7cff8ff..8580356ace5c7af12edaf004e8227877c3539df0 100644 (file)
@@ -432,11 +432,12 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr)
        }
 
        if (ax25_rt->digipeat != NULL) {
-               if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
+               ax25->digipeat = kmemdup(ax25_rt->digipeat, sizeof(ax25_digi),
+                                        GFP_ATOMIC);
+               if (ax25->digipeat == NULL) {
                        err = -ENOMEM;
                        goto put;
                }
-               memcpy(ax25->digipeat, ax25_rt->digipeat, sizeof(ax25_digi));
                ax25_adjust_path(addr, ax25->digipeat);
        }