]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/socket.c
[NET]: cleanup sock_from_file()
[karo-tx-linux.git] / net / socket.c
index 4e396312f8d58751d0c23914a056126e79ff72ac..fc74930f1443b659b082bcf53c99042c1548ea10 100644 (file)
@@ -407,24 +407,11 @@ int sock_map_fd(struct socket *sock)
 
 static struct socket *sock_from_file(struct file *file, int *err)
 {
-       struct inode *inode;
-       struct socket *sock;
-
        if (file->f_op == &socket_file_ops)
                return file->private_data;      /* set in sock_map_fd */
 
-       inode = file->f_path.dentry->d_inode;
-       if (!S_ISSOCK(inode->i_mode)) {
-               *err = -ENOTSOCK;
-               return NULL;
-       }
-
-       sock = SOCKET_I(inode);
-       if (sock->file != file) {
-               printk(KERN_ERR "socki_lookup: socket file changed!\n");
-               sock->file = file;
-       }
-       return sock;
+       *err = -ENOTSOCK;
+       return NULL;
 }
 
 /**