diff options
Diffstat (limited to 'net/netrom')
| -rw-r--r-- | net/netrom/af_netrom.c | 21 | ||||
| -rw-r--r-- | net/netrom/nr_timer.c | 2 |
2 files changed, 16 insertions, 7 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index ecc796878f38..1d50f801f181 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
| @@ -66,6 +66,14 @@ static DEFINE_SPINLOCK(nr_list_lock); | |||
| 66 | static const struct proto_ops nr_proto_ops; | 66 | static const struct proto_ops nr_proto_ops; |
| 67 | 67 | ||
| 68 | /* | 68 | /* |
| 69 | * NETROM network devices are virtual network devices encapsulating NETROM | ||
| 70 | * frames into AX.25 which will be sent through an AX.25 device, so form a | ||
| 71 | * special "super class" of normal net devices; split their locks off into a | ||
| 72 | * separate class since they always nest. | ||
| 73 | */ | ||
| 74 | static struct lock_class_key nr_netdev_xmit_lock_key; | ||
| 75 | |||
| 76 | /* | ||
| 69 | * Socket removal during an interrupt is now safe. | 77 | * Socket removal during an interrupt is now safe. |
| 70 | */ | 78 | */ |
| 71 | static void nr_remove_socket(struct sock *sk) | 79 | static void nr_remove_socket(struct sock *sk) |
| @@ -986,18 +994,18 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev) | |||
| 986 | nr_make->vl = 0; | 994 | nr_make->vl = 0; |
| 987 | nr_make->state = NR_STATE_3; | 995 | nr_make->state = NR_STATE_3; |
| 988 | sk_acceptq_added(sk); | 996 | sk_acceptq_added(sk); |
| 989 | |||
| 990 | nr_insert_socket(make); | ||
| 991 | |||
| 992 | skb_queue_head(&sk->sk_receive_queue, skb); | 997 | skb_queue_head(&sk->sk_receive_queue, skb); |
| 993 | 998 | ||
| 994 | nr_start_heartbeat(make); | ||
| 995 | nr_start_idletimer(make); | ||
| 996 | |||
| 997 | if (!sock_flag(sk, SOCK_DEAD)) | 999 | if (!sock_flag(sk, SOCK_DEAD)) |
| 998 | sk->sk_data_ready(sk, skb->len); | 1000 | sk->sk_data_ready(sk, skb->len); |
| 999 | 1001 | ||
| 1000 | bh_unlock_sock(sk); | 1002 | bh_unlock_sock(sk); |
| 1003 | |||
| 1004 | nr_insert_socket(make); | ||
| 1005 | |||
| 1006 | nr_start_heartbeat(make); | ||
| 1007 | nr_start_idletimer(make); | ||
| 1008 | |||
| 1001 | return 1; | 1009 | return 1; |
| 1002 | } | 1010 | } |
| 1003 | 1011 | ||
| @@ -1405,6 +1413,7 @@ static int __init nr_proto_init(void) | |||
| 1405 | free_netdev(dev); | 1413 | free_netdev(dev); |
| 1406 | goto fail; | 1414 | goto fail; |
| 1407 | } | 1415 | } |
| 1416 | lockdep_set_class(&dev->_xmit_lock, &nr_netdev_xmit_lock_key); | ||
| 1408 | dev_nr[i] = dev; | 1417 | dev_nr[i] = dev; |
| 1409 | } | 1418 | } |
| 1410 | 1419 | ||
diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c index 75b72d389ba9..ddba1c144260 100644 --- a/net/netrom/nr_timer.c +++ b/net/netrom/nr_timer.c | |||
| @@ -138,8 +138,8 @@ static void nr_heartbeat_expiry(unsigned long param) | |||
| 138 | if (sock_flag(sk, SOCK_DESTROY) || | 138 | if (sock_flag(sk, SOCK_DESTROY) || |
| 139 | (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) { | 139 | (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) { |
| 140 | sock_hold(sk); | 140 | sock_hold(sk); |
| 141 | nr_destroy_socket(sk); | ||
| 142 | bh_unlock_sock(sk); | 141 | bh_unlock_sock(sk); |
| 142 | nr_destroy_socket(sk); | ||
| 143 | sock_put(sk); | 143 | sock_put(sk); |
| 144 | return; | 144 | return; |
| 145 | } | 145 | } |
