summaryrefslogtreecommitdiffstats
path: root/net/ax25/ax25_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ax25/ax25_route.c')
-rw-r--r--net/ax25/ax25_route.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
index 51b7bda..8580356 100644
--- a/net/ax25/ax25_route.c
+++ b/net/ax25/ax25_route.c
@@ -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);
}
OpenPOWER on IntegriCloud