diff options
Diffstat (limited to 'net/phonet/socket.c')
-rw-r--r-- | net/phonet/socket.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/phonet/socket.c b/net/phonet/socket.c index b7e982782255..1afd1381cdc7 100644 --- a/net/phonet/socket.c +++ b/net/phonet/socket.c | |||
@@ -76,7 +76,6 @@ static struct hlist_head *pn_hash_list(u16 obj) | |||
76 | */ | 76 | */ |
77 | struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *spn) | 77 | struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *spn) |
78 | { | 78 | { |
79 | struct hlist_node *node; | ||
80 | struct sock *sknode; | 79 | struct sock *sknode; |
81 | struct sock *rval = NULL; | 80 | struct sock *rval = NULL; |
82 | u16 obj = pn_sockaddr_get_object(spn); | 81 | u16 obj = pn_sockaddr_get_object(spn); |
@@ -84,7 +83,7 @@ struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *spn) | |||
84 | struct hlist_head *hlist = pn_hash_list(obj); | 83 | struct hlist_head *hlist = pn_hash_list(obj); |
85 | 84 | ||
86 | rcu_read_lock(); | 85 | rcu_read_lock(); |
87 | sk_for_each_rcu(sknode, node, hlist) { | 86 | sk_for_each_rcu(sknode, hlist) { |
88 | struct pn_sock *pn = pn_sk(sknode); | 87 | struct pn_sock *pn = pn_sk(sknode); |
89 | BUG_ON(!pn->sobject); /* unbound socket */ | 88 | BUG_ON(!pn->sobject); /* unbound socket */ |
90 | 89 | ||
@@ -120,10 +119,9 @@ void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb) | |||
120 | 119 | ||
121 | rcu_read_lock(); | 120 | rcu_read_lock(); |
122 | for (h = 0; h < PN_HASHSIZE; h++) { | 121 | for (h = 0; h < PN_HASHSIZE; h++) { |
123 | struct hlist_node *node; | ||
124 | struct sock *sknode; | 122 | struct sock *sknode; |
125 | 123 | ||
126 | sk_for_each(sknode, node, hlist) { | 124 | sk_for_each(sknode, hlist) { |
127 | struct sk_buff *clone; | 125 | struct sk_buff *clone; |
128 | 126 | ||
129 | if (!net_eq(sock_net(sknode), net)) | 127 | if (!net_eq(sock_net(sknode), net)) |
@@ -543,12 +541,11 @@ static struct sock *pn_sock_get_idx(struct seq_file *seq, loff_t pos) | |||
543 | { | 541 | { |
544 | struct net *net = seq_file_net(seq); | 542 | struct net *net = seq_file_net(seq); |
545 | struct hlist_head *hlist = pnsocks.hlist; | 543 | struct hlist_head *hlist = pnsocks.hlist; |
546 | struct hlist_node *node; | ||
547 | struct sock *sknode; | 544 | struct sock *sknode; |
548 | unsigned int h; | 545 | unsigned int h; |
549 | 546 | ||
550 | for (h = 0; h < PN_HASHSIZE; h++) { | 547 | for (h = 0; h < PN_HASHSIZE; h++) { |
551 | sk_for_each_rcu(sknode, node, hlist) { | 548 | sk_for_each_rcu(sknode, hlist) { |
552 | if (!net_eq(net, sock_net(sknode))) | 549 | if (!net_eq(net, sock_net(sknode))) |
553 | continue; | 550 | continue; |
554 | if (!pos) | 551 | if (!pos) |