diff options
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/socket.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index f972c0b4a719..1a2eb23c6223 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -1755,20 +1755,16 @@ static int getsockopt(struct socket *sock, | |||
1755 | 1755 | ||
1756 | release_sock(sk); | 1756 | release_sock(sk); |
1757 | 1757 | ||
1758 | if (res) { | 1758 | if (res) |
1759 | /* "get" failed */ | 1759 | return res; /* "get" failed */ |
1760 | } | ||
1761 | else if (len < sizeof(value)) { | ||
1762 | res = -EINVAL; | ||
1763 | } | ||
1764 | else if (copy_to_user(ov, &value, sizeof(value))) { | ||
1765 | res = -EFAULT; | ||
1766 | } | ||
1767 | else { | ||
1768 | res = put_user(sizeof(value), ol); | ||
1769 | } | ||
1770 | 1760 | ||
1771 | return res; | 1761 | if (len < sizeof(value)) |
1762 | return -EINVAL; | ||
1763 | |||
1764 | if (copy_to_user(ov, &value, sizeof(value))) | ||
1765 | return -EFAULT; | ||
1766 | |||
1767 | return put_user(sizeof(value), ol); | ||
1772 | } | 1768 | } |
1773 | 1769 | ||
1774 | /** | 1770 | /** |