]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/unix/af_unix.c
Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
[linux.git] / net / unix / af_unix.c
index 0d8da809bea2e6053c6bd5687ae19ab3f3ca617a..7cfdce10de36b70104229e122d76aea272d80a05 100644 (file)
@@ -284,11 +284,9 @@ static struct sock *__unix_find_socket_byname(struct net *net,
 
                if (u->addr->len == len &&
                    !memcmp(u->addr->name, sunname, len))
-                       goto found;
+                       return s;
        }
-       s = NULL;
-found:
-       return s;
+       return NULL;
 }
 
 static inline struct sock *unix_find_socket_byname(struct net *net,
@@ -646,6 +644,9 @@ static __poll_t unix_poll(struct file *, struct socket *, poll_table *);
 static __poll_t unix_dgram_poll(struct file *, struct socket *,
                                    poll_table *);
 static int unix_ioctl(struct socket *, unsigned int, unsigned long);
+#ifdef CONFIG_COMPAT
+static int unix_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
+#endif
 static int unix_shutdown(struct socket *, int);
 static int unix_stream_sendmsg(struct socket *, struct msghdr *, size_t);
 static int unix_stream_recvmsg(struct socket *, struct msghdr *, size_t, int);
@@ -687,6 +688,9 @@ static const struct proto_ops unix_stream_ops = {
        .getname =      unix_getname,
        .poll =         unix_poll,
        .ioctl =        unix_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = unix_compat_ioctl,
+#endif
        .listen =       unix_listen,
        .shutdown =     unix_shutdown,
        .setsockopt =   sock_no_setsockopt,
@@ -710,6 +714,9 @@ static const struct proto_ops unix_dgram_ops = {
        .getname =      unix_getname,
        .poll =         unix_dgram_poll,
        .ioctl =        unix_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = unix_compat_ioctl,
+#endif
        .listen =       sock_no_listen,
        .shutdown =     unix_shutdown,
        .setsockopt =   sock_no_setsockopt,
@@ -732,6 +739,9 @@ static const struct proto_ops unix_seqpacket_ops = {
        .getname =      unix_getname,
        .poll =         unix_dgram_poll,
        .ioctl =        unix_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = unix_compat_ioctl,
+#endif
        .listen =       unix_listen,
        .shutdown =     unix_shutdown,
        .setsockopt =   sock_no_setsockopt,
@@ -2582,6 +2592,13 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
        return err;
 }
 
+#ifdef CONFIG_COMPAT
+static int unix_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+{
+       return unix_ioctl(sock, cmd, (unsigned long)compat_ptr(arg));
+}
+#endif
+
 static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wait)
 {
        struct sock *sk = sock->sk;