aboutsummaryrefslogtreecommitdiffstats
path: root/net/netrom/nr_route.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-12-05 09:37:56 -0500
committerDavid Howells <dhowells@warthog.cambridge.redhat.com>2006-12-05 09:37:56 -0500
commit4c1ac1b49122b805adfa4efc620592f68dccf5db (patch)
tree87557f4bc2fd4fe65b7570489c2f610c45c0adcd /net/netrom/nr_route.c
parentc4028958b6ecad064b1a6303a6a5906d4fe48d73 (diff)
parentd916faace3efc0bf19fe9a615a1ab8fa1a24cd93 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/infiniband/core/iwcm.c drivers/net/chelsio/cxgb2.c drivers/net/wireless/bcm43xx/bcm43xx_main.c drivers/net/wireless/prism54/islpci_eth.c drivers/usb/core/hub.h drivers/usb/input/hid-core.c net/core/netpoll.c Fix up merge failures with Linus's head and fix new compilation failures. Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/netrom/nr_route.c')
-rw-r--r--net/netrom/nr_route.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c
index c11737f472d6..0096105bcd47 100644
--- a/net/netrom/nr_route.c
+++ b/net/netrom/nr_route.c
@@ -155,14 +155,15 @@ static int nr_add_node(ax25_address *nr, const char *mnemonic, ax25_address *ax2
155 atomic_set(&nr_neigh->refcount, 1); 155 atomic_set(&nr_neigh->refcount, 1);
156 156
157 if (ax25_digi != NULL && ax25_digi->ndigi > 0) { 157 if (ax25_digi != NULL && ax25_digi->ndigi > 0) {
158 if ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) == NULL) { 158 nr_neigh->digipeat = kmemdup(ax25_digi,
159 sizeof(*ax25_digi),
160 GFP_KERNEL);
161 if (nr_neigh->digipeat == NULL) {
159 kfree(nr_neigh); 162 kfree(nr_neigh);
160 if (nr_node) 163 if (nr_node)
161 nr_node_put(nr_node); 164 nr_node_put(nr_node);
162 return -ENOMEM; 165 return -ENOMEM;
163 } 166 }
164 memcpy(nr_neigh->digipeat, ax25_digi,
165 sizeof(*ax25_digi));
166 } 167 }
167 168
168 spin_lock_bh(&nr_neigh_list_lock); 169 spin_lock_bh(&nr_neigh_list_lock);
@@ -432,11 +433,12 @@ static int nr_add_neigh(ax25_address *callsign, ax25_digi *ax25_digi, struct net
432 atomic_set(&nr_neigh->refcount, 1); 433 atomic_set(&nr_neigh->refcount, 1);
433 434
434 if (ax25_digi != NULL && ax25_digi->ndigi > 0) { 435 if (ax25_digi != NULL && ax25_digi->ndigi > 0) {
435 if ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) == NULL) { 436 nr_neigh->digipeat = kmemdup(ax25_digi, sizeof(*ax25_digi),
437 GFP_KERNEL);
438 if (nr_neigh->digipeat == NULL) {
436 kfree(nr_neigh); 439 kfree(nr_neigh);
437 return -ENOMEM; 440 return -ENOMEM;
438 } 441 }
439 memcpy(nr_neigh->digipeat, ax25_digi, sizeof(*ax25_digi));
440 } 442 }
441 443
442 spin_lock_bh(&nr_neigh_list_lock); 444 spin_lock_bh(&nr_neigh_list_lock);