aboutsummaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
Diffstat (limited to 'net/core')
-rw-r--r--net/core/sock.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index dd63cdea3fe..1a7e6eac90b 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1386,14 +1386,14 @@ int sock_common_getsockopt(struct socket *sock, int level, int optname,
EXPORT_SYMBOL(sock_common_getsockopt);
#ifdef CONFIG_COMPAT
-int compat_sock_common_getsockopt(struct socket *sock, int level,
- int optname, char __user *optval, int __user *optlen)
+int compat_sock_common_getsockopt(struct socket *sock, int level, int optname,
+ char __user *optval, int __user *optlen)
{
struct sock *sk = sock->sk;
- if (sk->sk_prot->compat_setsockopt)
- return sk->sk_prot->compat_getsockopt(sk, level,
- optname, optval, optlen);
+ if (sk->sk_prot->compat_setsockopt != NULL)
+ return sk->sk_prot->compat_getsockopt(sk, level, optname,
+ optval, optlen);
return sk->sk_prot->getsockopt(sk, level, optname, optval, optlen);
}
EXPORT_SYMBOL(compat_sock_common_getsockopt);
@@ -1429,14 +1429,14 @@ int sock_common_setsockopt(struct socket *sock, int level, int optname,
EXPORT_SYMBOL(sock_common_setsockopt);
#ifdef CONFIG_COMPAT
-int compat_sock_common_setsockopt(struct socket *sock,
- int level, int optname, char __user *optval, int optlen)
+int compat_sock_common_setsockopt(struct socket *sock, int level, int optname,
+ char __user *optval, int optlen)
{
struct sock *sk = sock->sk;
- if (sk->sk_prot->compat_setsockopt)
- return sk->sk_prot->compat_setsockopt(sk, level,
- optname, optval, optlen);
+ if (sk->sk_prot->compat_setsockopt != NULL)
+ return sk->sk_prot->compat_setsockopt(sk, level, optname,
+ optval, optlen);
return sk->sk_prot->setsockopt(sk, level, optname, optval, optlen);
}
EXPORT_SYMBOL(compat_sock_common_setsockopt);