kcm: remove a useless copy_from_user()

struct kcm_clone only contains fd, and kcm_clone() only
writes this struct, so there is no need to copy it from user.

Cc: Tom Herbert <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
WANG Cong 2017-04-13 11:38:02 -07:00 • committed by David S. Miller
commit f5001ceab8

View file

@ -1707,11 +1707,7 @@ static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
struct kcm_clone info;
struct socket *newsock = NULL;
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
return -EFAULT;
err = kcm_clone(sock, &info, &newsock);
if (!err) {
if (copy_to_user((void __user *)arg, &info,
sizeof(info))) {