diff options
| author | Christoph Hellwig <[email protected]> | 2020-07-23 06:09:07 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2020-07-24 22:41:54 +0000 |
| commit | a7b75c5a8c41445f33efb663887ff5f5c3b4454b (patch) | |
| tree | a87e011ba3a0d76fda030b3a62080caa97fae1ef /net/netrom/af_netrom.c | |
| parent | net/tcp: switch do_tcp_setsockopt to sockptr_t (diff) | |
| download | kernel-a7b75c5a8c41445f33efb663887ff5f5c3b4454b.tar.gz kernel-a7b75c5a8c41445f33efb663887ff5f5c3b4454b.zip | |
net: pass a sockptr_t into ->setsockopt
Rework the remaining setsockopt code to pass a sockptr_t instead of a
plain user pointer. This removes the last remaining set_fs(KERNEL_DS)
outside of architecture specific code.
Signed-off-by: Christoph Hellwig <[email protected]>
Acked-by: Stefan Schmidt <[email protected]> [ieee802154]
Acked-by: Matthieu Baerts <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/netrom/af_netrom.c')
| -rw-r--r-- | net/netrom/af_netrom.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index f90ef6934b8f..6d16e1ab1a8a 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -294,7 +294,7 @@ void nr_destroy_socket(struct sock *sk) */ static int nr_setsockopt(struct socket *sock, int level, int optname, - char __user *optval, unsigned int optlen) + sockptr_t optval, unsigned int optlen) { struct sock *sk = sock->sk; struct nr_sock *nr = nr_sk(sk); @@ -306,7 +306,7 @@ static int nr_setsockopt(struct socket *sock, int level, int optname, if (optlen < sizeof(unsigned int)) return -EINVAL; - if (get_user(opt, (unsigned int __user *)optval)) + if (copy_from_sockptr(&opt, optval, sizeof(unsigned int))) return -EFAULT; switch (optname) { |
