Skip to content

Commit

Permalink
X25 remove bkl from calluserdata ioctls
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Hendry <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
AndrewHendry authored and davem330 committed Nov 28, 2010
1 parent f90de66 commit 5b7958d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions net/x25/af_x25.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,27 +1512,27 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
}

case SIOCX25GCALLUSERDATA: {
struct x25_calluserdata cud = x25->calluserdata;
lock_kernel();
rc = copy_to_user(argp, &cud,
sizeof(cud)) ? -EFAULT : 0;
unlock_kernel();
lock_sock(sk);
rc = copy_to_user(argp, &x25->calluserdata,
sizeof(x25->calluserdata))
? -EFAULT : 0;
release_sock(sk);
break;
}

case SIOCX25SCALLUSERDATA: {
struct x25_calluserdata calluserdata;

rc = -EFAULT;
lock_kernel();
if (copy_from_user(&calluserdata, argp,
sizeof(calluserdata)))
break;
rc = -EINVAL;
if (calluserdata.cudlength > X25_MAX_CUD_LEN)
break;
lock_sock(sk);
x25->calluserdata = calluserdata;
unlock_kernel();
release_sock(sk);
rc = 0;
break;
}
Expand Down

0 comments on commit 5b7958d

Please sign in to comment.