aboutsummaryrefslogtreecommitdiffstats
path: root/net/netrom/af_netrom.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netrom/af_netrom.c')
-rw-r--r--net/netrom/af_netrom.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 4bae8b998cab..fccc250f95f5 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -74,6 +74,18 @@ static const struct proto_ops nr_proto_ops;
74 */ 74 */
75static struct lock_class_key nr_netdev_xmit_lock_key; 75static struct lock_class_key nr_netdev_xmit_lock_key;
76 76
77static void nr_set_lockdep_one(struct net_device *dev,
78 struct netdev_queue *txq,
79 void *_unused)
80{
81 lockdep_set_class(&txq->_xmit_lock, &nr_netdev_xmit_lock_key);
82}
83
84static void nr_set_lockdep_key(struct net_device *dev)
85{
86 netdev_for_each_tx_queue(dev, nr_set_lockdep_one, NULL);
87}
88
77/* 89/*
78 * Socket removal during an interrupt is now safe. 90 * Socket removal during an interrupt is now safe.
79 */ 91 */
@@ -106,7 +118,7 @@ static int nr_device_event(struct notifier_block *this, unsigned long event, voi
106{ 118{
107 struct net_device *dev = (struct net_device *)ptr; 119 struct net_device *dev = (struct net_device *)ptr;
108 120
109 if (dev_net(dev) != &init_net) 121 if (!net_eq(dev_net(dev), &init_net))
110 return NOTIFY_DONE; 122 return NOTIFY_DONE;
111 123
112 if (event != NETDEV_DOWN) 124 if (event != NETDEV_DOWN)
@@ -475,13 +487,11 @@ static struct sock *nr_make_new(struct sock *osk)
475 sock_init_data(NULL, sk); 487 sock_init_data(NULL, sk);
476 488
477 sk->sk_type = osk->sk_type; 489 sk->sk_type = osk->sk_type;
478 sk->sk_socket = osk->sk_socket;
479 sk->sk_priority = osk->sk_priority; 490 sk->sk_priority = osk->sk_priority;
480 sk->sk_protocol = osk->sk_protocol; 491 sk->sk_protocol = osk->sk_protocol;
481 sk->sk_rcvbuf = osk->sk_rcvbuf; 492 sk->sk_rcvbuf = osk->sk_rcvbuf;
482 sk->sk_sndbuf = osk->sk_sndbuf; 493 sk->sk_sndbuf = osk->sk_sndbuf;
483 sk->sk_state = TCP_ESTABLISHED; 494 sk->sk_state = TCP_ESTABLISHED;
484 sk->sk_sleep = osk->sk_sleep;
485 sock_copy_flags(sk, osk); 495 sock_copy_flags(sk, osk);
486 496
487 skb_queue_head_init(&nr->ack_queue); 497 skb_queue_head_init(&nr->ack_queue);
@@ -538,11 +548,9 @@ static int nr_release(struct socket *sock)
538 sk->sk_state_change(sk); 548 sk->sk_state_change(sk);
539 sock_orphan(sk); 549 sock_orphan(sk);
540 sock_set_flag(sk, SOCK_DESTROY); 550 sock_set_flag(sk, SOCK_DESTROY);
541 sk->sk_socket = NULL;
542 break; 551 break;
543 552
544 default: 553 default:
545 sk->sk_socket = NULL;
546 break; 554 break;
547 } 555 }
548 556
@@ -810,13 +818,11 @@ static int nr_accept(struct socket *sock, struct socket *newsock, int flags)
810 goto out_release; 818 goto out_release;
811 819
812 newsk = skb->sk; 820 newsk = skb->sk;
813 newsk->sk_socket = newsock; 821 sock_graft(newsk, newsock);
814 newsk->sk_sleep = &newsock->wait;
815 822
816 /* Now attach up the new socket */ 823 /* Now attach up the new socket */
817 kfree_skb(skb); 824 kfree_skb(skb);
818 sk_acceptq_removed(sk); 825 sk_acceptq_removed(sk);
819 newsock->sk = newsk;
820 826
821out_release: 827out_release:
822 release_sock(sk); 828 release_sock(sk);
@@ -1436,7 +1442,7 @@ static int __init nr_proto_init(void)
1436 free_netdev(dev); 1442 free_netdev(dev);
1437 goto fail; 1443 goto fail;
1438 } 1444 }
1439 lockdep_set_class(&dev->_xmit_lock, &nr_netdev_xmit_lock_key); 1445 nr_set_lockdep_key(dev);
1440 dev_nr[i] = dev; 1446 dev_nr[i] = dev;
1441 } 1447 }
1442 1448