Skip to content

Commit

Permalink
can-isotp: pass a sockptr_t into ->setsockopt - for Linux 5.9+
Browse files Browse the repository at this point in the history
Following upstream commit a7b75c5a8c41
("net: pass a sockptr_t into ->setsockopt")

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
  • Loading branch information
hartkopp committed Aug 12, 2020
1 parent ced84ca commit 0cb92ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/can/isotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,11 @@ static int isotp_getname(struct socket *sock, struct sockaddr *uaddr,
#endif
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
#define copy_from_user copy_from_sockptr
static int isotp_setsockopt(struct socket *sock, int level, int optname,
sockptr_t optval, unsigned int optlen)
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
static int isotp_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, unsigned int optlen)
#else
Expand Down

0 comments on commit 0cb92ae

Please sign in to comment.