diff options
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 6 | ||||
-rw-r--r-- | net/unix/diag.c | 7 |
2 files changed, 4 insertions, 9 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 87d284289012..51be64f163ec 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -263,9 +263,8 @@ static struct sock *__unix_find_socket_byname(struct net *net, | |||
263 | int len, int type, unsigned int hash) | 263 | int len, int type, unsigned int hash) |
264 | { | 264 | { |
265 | struct sock *s; | 265 | struct sock *s; |
266 | struct hlist_node *node; | ||
267 | 266 | ||
268 | sk_for_each(s, node, &unix_socket_table[hash ^ type]) { | 267 | sk_for_each(s, &unix_socket_table[hash ^ type]) { |
269 | struct unix_sock *u = unix_sk(s); | 268 | struct unix_sock *u = unix_sk(s); |
270 | 269 | ||
271 | if (!net_eq(sock_net(s), net)) | 270 | if (!net_eq(sock_net(s), net)) |
@@ -298,10 +297,9 @@ static inline struct sock *unix_find_socket_byname(struct net *net, | |||
298 | static struct sock *unix_find_socket_byinode(struct inode *i) | 297 | static struct sock *unix_find_socket_byinode(struct inode *i) |
299 | { | 298 | { |
300 | struct sock *s; | 299 | struct sock *s; |
301 | struct hlist_node *node; | ||
302 | 300 | ||
303 | spin_lock(&unix_table_lock); | 301 | spin_lock(&unix_table_lock); |
304 | sk_for_each(s, node, | 302 | sk_for_each(s, |
305 | &unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) { | 303 | &unix_socket_table[i->i_ino & (UNIX_HASH_SIZE - 1)]) { |
306 | struct dentry *dentry = unix_sk(s)->path.dentry; | 304 | struct dentry *dentry = unix_sk(s)->path.dentry; |
307 | 305 | ||
diff --git a/net/unix/diag.c b/net/unix/diag.c index 5ac19dc1d5e4..d591091603bf 100644 --- a/net/unix/diag.c +++ b/net/unix/diag.c | |||
@@ -192,10 +192,9 @@ static int unix_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
192 | slot < ARRAY_SIZE(unix_socket_table); | 192 | slot < ARRAY_SIZE(unix_socket_table); |
193 | s_num = 0, slot++) { | 193 | s_num = 0, slot++) { |
194 | struct sock *sk; | 194 | struct sock *sk; |
195 | struct hlist_node *node; | ||
196 | 195 | ||
197 | num = 0; | 196 | num = 0; |
198 | sk_for_each(sk, node, &unix_socket_table[slot]) { | 197 | sk_for_each(sk, &unix_socket_table[slot]) { |
199 | if (!net_eq(sock_net(sk), net)) | 198 | if (!net_eq(sock_net(sk), net)) |
200 | continue; | 199 | continue; |
201 | if (num < s_num) | 200 | if (num < s_num) |
@@ -226,9 +225,7 @@ static struct sock *unix_lookup_by_ino(int ino) | |||
226 | 225 | ||
227 | spin_lock(&unix_table_lock); | 226 | spin_lock(&unix_table_lock); |
228 | for (i = 0; i < ARRAY_SIZE(unix_socket_table); i++) { | 227 | for (i = 0; i < ARRAY_SIZE(unix_socket_table); i++) { |
229 | struct hlist_node *node; | 228 | sk_for_each(sk, &unix_socket_table[i]) |
230 | |||
231 | sk_for_each(sk, node, &unix_socket_table[i]) | ||
232 | if (ino == sock_i_ino(sk)) { | 229 | if (ino == sock_i_ino(sk)) { |
233 | sock_hold(sk); | 230 | sock_hold(sk); |
234 | spin_unlock(&unix_table_lock); | 231 | spin_unlock(&unix_table_lock); |