aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose
diff options
context:
space:
mode:
Diffstat (limited to 'net/rose')
-rw-r--r--net/rose/rose_loopback.c4
-rw-r--r--net/rose/rose_route.c15
2 files changed, 12 insertions, 7 deletions
diff --git a/net/rose/rose_loopback.c b/net/rose/rose_loopback.c
index cd01642f0491..114df6eec8c3 100644
--- a/net/rose/rose_loopback.c
+++ b/net/rose/rose_loopback.c
@@ -79,7 +79,7 @@ static void rose_loopback_timer(unsigned long param)
79 79
80 skb_reset_transport_header(skb); 80 skb_reset_transport_header(skb);
81 81
82 sk = rose_find_socket(lci_o, &rose_loopback_neigh); 82 sk = rose_find_socket(lci_o, rose_loopback_neigh);
83 if (sk) { 83 if (sk) {
84 if (rose_process_rx_frame(sk, skb) == 0) 84 if (rose_process_rx_frame(sk, skb) == 0)
85 kfree_skb(skb); 85 kfree_skb(skb);
@@ -88,7 +88,7 @@ static void rose_loopback_timer(unsigned long param)
88 88
89 if (frametype == ROSE_CALL_REQUEST) { 89 if (frametype == ROSE_CALL_REQUEST) {
90 if ((dev = rose_dev_get(dest)) != NULL) { 90 if ((dev = rose_dev_get(dest)) != NULL) {
91 if (rose_rx_call_request(skb, dev, &rose_loopback_neigh, lci_o) == 0) 91 if (rose_rx_call_request(skb, dev, rose_loopback_neigh, lci_o) == 0)
92 kfree_skb(skb); 92 kfree_skb(skb);
93 } else { 93 } else {
94 kfree_skb(skb); 94 kfree_skb(skb);
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index bbcbad1da0d0..96f61a71b252 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -45,7 +45,7 @@ static DEFINE_SPINLOCK(rose_neigh_list_lock);
45static struct rose_route *rose_route_list; 45static struct rose_route *rose_route_list;
46static DEFINE_SPINLOCK(rose_route_list_lock); 46static DEFINE_SPINLOCK(rose_route_list_lock);
47 47
48struct rose_neigh rose_loopback_neigh; 48struct rose_neigh *rose_loopback_neigh;
49 49
50/* 50/*
51 * Add a new route to a node, and in the process add the node and the 51 * Add a new route to a node, and in the process add the node and the
@@ -362,7 +362,12 @@ out:
362 */ 362 */
363void rose_add_loopback_neigh(void) 363void rose_add_loopback_neigh(void)
364{ 364{
365 struct rose_neigh *sn = &rose_loopback_neigh; 365 struct rose_neigh *sn;
366
367 rose_loopback_neigh = kmalloc(sizeof(struct rose_neigh), GFP_KERNEL);
368 if (!rose_loopback_neigh)
369 return;
370 sn = rose_loopback_neigh;
366 371
367 sn->callsign = null_ax25_address; 372 sn->callsign = null_ax25_address;
368 sn->digipeat = NULL; 373 sn->digipeat = NULL;
@@ -417,13 +422,13 @@ int rose_add_loopback_node(rose_address *address)
417 rose_node->mask = 10; 422 rose_node->mask = 10;
418 rose_node->count = 1; 423 rose_node->count = 1;
419 rose_node->loopback = 1; 424 rose_node->loopback = 1;
420 rose_node->neighbour[0] = &rose_loopback_neigh; 425 rose_node->neighbour[0] = rose_loopback_neigh;
421 426
422 /* Insert at the head of list. Address is always mask=10 */ 427 /* Insert at the head of list. Address is always mask=10 */
423 rose_node->next = rose_node_list; 428 rose_node->next = rose_node_list;
424 rose_node_list = rose_node; 429 rose_node_list = rose_node;
425 430
426 rose_loopback_neigh.count++; 431 rose_loopback_neigh->count++;
427 432
428out: 433out:
429 spin_unlock_bh(&rose_node_list_lock); 434 spin_unlock_bh(&rose_node_list_lock);
@@ -454,7 +459,7 @@ void rose_del_loopback_node(rose_address *address)
454 459
455 rose_remove_node(rose_node); 460 rose_remove_node(rose_node);
456 461
457 rose_loopback_neigh.count--; 462 rose_loopback_neigh->count--;
458 463
459out: 464out:
460 spin_unlock_bh(&rose_node_list_lock); 465 spin_unlock_bh(&rose_node_list_lock);