Skip to content

Commit

Permalink
X25 remove bkl in call user data length ioctl
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
andrew hendry authored and David S. Miller committed Nov 28, 2010
1 parent 74a7e44 commit 3f0a069
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions net/x25/af_x25.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,19 +1562,20 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCX25SCUDMATCHLEN: {
struct x25_subaddr sub_addr;
rc = -EINVAL;
lock_kernel();
lock_sock(sk);
if(sk->sk_state != TCP_CLOSE)
break;
goto out_cud_release;
rc = -EFAULT;
if (copy_from_user(&sub_addr, argp,
sizeof(sub_addr)))
break;
goto out_cud_release;
rc = -EINVAL;
if(sub_addr.cudmatchlength > X25_MAX_CUD_LEN)
break;
goto out_cud_release;
x25->cudmatchlength = sub_addr.cudmatchlength;
unlock_kernel();
rc = 0;
out_cud_release:
release_sock(sk);
break;
}

Expand Down

0 comments on commit 3f0a069

Please sign in to comment.