]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/tipc/socket.c
[XFS] Fix memory corruption with small buffer reads
[linux-2.6-omap-h63xx.git] / net / tipc / socket.c
index 05853159536a03b984708c400808dcf6e26fcb77..230f9ca2ad6b361dd4e78e6a2f1247334e9b9d22 100644 (file)
@@ -1756,8 +1756,8 @@ static int getsockopt(struct socket *sock,
        else if (len < sizeof(value)) {
                res = -EINVAL;
        }
-       else if ((res = copy_to_user(ov, &value, sizeof(value)))) {
-               /* couldn't return value */
+       else if (copy_to_user(ov, &value, sizeof(value))) {
+               res = -EFAULT;
        }
        else {
                res = put_user(sizeof(value), ol);