Skip to content

Commit

Permalink
kcm: remove a useless copy_from_user()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
congwang authored and davem330 committed Apr 17, 2017
1 parent 6b2af24 commit f5001ce
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions net/kcm/kcmsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down

0 comments on commit f5001ce

Please sign in to comment.