diff options
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 5b5c876c80e9..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 | ||
@@ -2402,7 +2400,7 @@ static int __net_init unix_net_init(struct net *net) | |||
2402 | goto out; | 2400 | goto out; |
2403 | 2401 | ||
2404 | #ifdef CONFIG_PROC_FS | 2402 | #ifdef CONFIG_PROC_FS |
2405 | if (!proc_net_fops_create(net, "unix", 0, &unix_seq_fops)) { | 2403 | if (!proc_create("unix", 0, net->proc_net, &unix_seq_fops)) { |
2406 | unix_sysctl_unregister(net); | 2404 | unix_sysctl_unregister(net); |
2407 | goto out; | 2405 | goto out; |
2408 | } | 2406 | } |
@@ -2415,7 +2413,7 @@ out: | |||
2415 | static void __net_exit unix_net_exit(struct net *net) | 2413 | static void __net_exit unix_net_exit(struct net *net) |
2416 | { | 2414 | { |
2417 | unix_sysctl_unregister(net); | 2415 | unix_sysctl_unregister(net); |
2418 | proc_net_remove(net, "unix"); | 2416 | remove_proc_entry("unix", net->proc_net); |
2419 | } | 2417 | } |
2420 | 2418 | ||
2421 | static struct pernet_operations unix_net_ops = { | 2419 | static struct pernet_operations unix_net_ops = { |
@@ -2426,9 +2424,8 @@ static struct pernet_operations unix_net_ops = { | |||
2426 | static int __init af_unix_init(void) | 2424 | static int __init af_unix_init(void) |
2427 | { | 2425 | { |
2428 | int rc = -1; | 2426 | int rc = -1; |
2429 | struct sk_buff *dummy_skb; | ||
2430 | 2427 | ||
2431 | BUILD_BUG_ON(sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb)); | 2428 | BUILD_BUG_ON(sizeof(struct unix_skb_parms) > FIELD_SIZEOF(struct sk_buff, cb)); |
2432 | 2429 | ||
2433 | rc = proto_register(&unix_proto, 1); | 2430 | rc = proto_register(&unix_proto, 1); |
2434 | if (rc != 0) { | 2431 | if (rc != 0) { |