Commit 74a7e440 authored by andrew hendry's avatar andrew hendry Committed by David S. Miller

X25 remove bkl from causediag ioctls

Signed-off-by: default avatarAndrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5b7958df
...@@ -1538,23 +1538,22 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1538,23 +1538,22 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
} }
case SIOCX25GCAUSEDIAG: { case SIOCX25GCAUSEDIAG: {
struct x25_causediag causediag; lock_sock(sk);
lock_kernel(); rc = copy_to_user(argp, &x25->causediag,
causediag = x25->causediag; sizeof(x25->causediag))
rc = copy_to_user(argp, &causediag, ? -EFAULT : 0;
sizeof(causediag)) ? -EFAULT : 0; release_sock(sk);
unlock_kernel();
break; break;
} }
case SIOCX25SCAUSEDIAG: { case SIOCX25SCAUSEDIAG: {
struct x25_causediag causediag; struct x25_causediag causediag;
rc = -EFAULT; rc = -EFAULT;
lock_kernel();
if (copy_from_user(&causediag, argp, sizeof(causediag))) if (copy_from_user(&causediag, argp, sizeof(causediag)))
break; break;
lock_sock(sk);
x25->causediag = causediag; x25->causediag = causediag;
unlock_kernel(); release_sock(sk);
rc = 0; rc = 0;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment