aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-03 02:26:33 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-03 02:26:33 -0400
commitc50e86ce7c2961a41f2f7aa6e4fd6c99229ba205 (patch)
tree4ea36009719bd8fc523239fe1bdccb90f0dce3ae /net/socket.c
parent14d33d384693eb6083396199de516fdef320f7af (diff)
parent4cbe5a555fa58a79b6ecbb6c531b8bab0650778d (diff)
Merge tag 'v3.6-rc4'
Merge 3.6-rc4 to get latest OMAP and device tree fixes.
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/socket.c b/net/socket.c
index 6e0ccc09b313..a5471f804d99 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -398,7 +398,7 @@ int sock_map_fd(struct socket *sock, int flags)
398} 398}
399EXPORT_SYMBOL(sock_map_fd); 399EXPORT_SYMBOL(sock_map_fd);
400 400
401static struct socket *sock_from_file(struct file *file, int *err) 401struct socket *sock_from_file(struct file *file, int *err)
402{ 402{
403 if (file->f_op == &socket_file_ops) 403 if (file->f_op == &socket_file_ops)
404 return file->private_data; /* set in sock_map_fd */ 404 return file->private_data; /* set in sock_map_fd */
@@ -406,6 +406,7 @@ static struct socket *sock_from_file(struct file *file, int *err)
406 *err = -ENOTSOCK; 406 *err = -ENOTSOCK;
407 return NULL; 407 return NULL;
408} 408}
409EXPORT_SYMBOL(sock_from_file);
409 410
410/** 411/**
411 * sockfd_lookup - Go from a file number to its socket slot 412 * sockfd_lookup - Go from a file number to its socket slot
@@ -522,6 +523,9 @@ void sock_release(struct socket *sock)
522 if (rcu_dereference_protected(sock->wq, 1)->fasync_list) 523 if (rcu_dereference_protected(sock->wq, 1)->fasync_list)
523 printk(KERN_ERR "sock_release: fasync list not empty!\n"); 524 printk(KERN_ERR "sock_release: fasync list not empty!\n");
524 525
526 if (test_bit(SOCK_EXTERNALLY_ALLOCATED, &sock->flags))
527 return;
528
525 this_cpu_sub(sockets_in_use, 1); 529 this_cpu_sub(sockets_in_use, 1);
526 if (!sock->file) { 530 if (!sock->file) {
527 iput(SOCK_INODE(sock)); 531 iput(SOCK_INODE(sock));
@@ -551,8 +555,6 @@ static inline int __sock_sendmsg_nosec(struct kiocb *iocb, struct socket *sock,
551 555
552 sock_update_classid(sock->sk); 556 sock_update_classid(sock->sk);
553 557
554 sock_update_netprioidx(sock->sk);
555
556 si->sock = sock; 558 si->sock = sock;
557 si->scm = NULL; 559 si->scm = NULL;
558 si->msg = msg; 560 si->msg = msg;
@@ -2655,6 +2657,7 @@ static int dev_ifconf(struct net *net, struct compat_ifconf __user *uifc32)
2655 if (copy_from_user(&ifc32, uifc32, sizeof(struct compat_ifconf))) 2657 if (copy_from_user(&ifc32, uifc32, sizeof(struct compat_ifconf)))
2656 return -EFAULT; 2658 return -EFAULT;
2657 2659
2660 memset(&ifc, 0, sizeof(ifc));
2658 if (ifc32.ifcbuf == 0) { 2661 if (ifc32.ifcbuf == 0) {
2659 ifc32.ifc_len = 0; 2662 ifc32.ifc_len = 0;
2660 ifc.ifc_len = 0; 2663 ifc.ifc_len = 0;