X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fbluetooth%2Fbnep%2Fsock.c;h=990e503a1ff157b7354b902a0cbff81878202075;hb=836b7aab793962aeac45cedd049970ca058258d5;hp=0978a58b77037e53eedb1be33aeca954e3f05ce9;hpb=56985ab57d52a966a60f5e812e166d1b4c9c120a;p=linux-2.6.git diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c index 0978a58b7..990e503a1 100644 --- a/net/bluetooth/bnep/sock.c +++ b/net/bluetooth/bnep/sock.c @@ -77,6 +77,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long struct bnep_conndel_req cd; struct bnep_conninfo ci; struct socket *nsock; + void __user *argp = (void __user *)arg; int err; BT_DBG("cmd %x arg %lx", cmd, arg); @@ -86,7 +87,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long if (!capable(CAP_NET_ADMIN)) return -EACCES; - if (copy_from_user(&ca, (void *) arg, sizeof(ca))) + if (copy_from_user(&ca, argp, sizeof(ca))) return -EFAULT; nsock = sockfd_lookup(ca.sock, &err); @@ -100,7 +101,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long err = bnep_add_connection(&ca, nsock); if (!err) { - if (copy_to_user((void *) arg, &ca, sizeof(ca))) + if (copy_to_user(argp, &ca, sizeof(ca))) err = -EFAULT; } else fput(nsock->file); @@ -111,30 +112,30 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long if (!capable(CAP_NET_ADMIN)) return -EACCES; - if (copy_from_user(&cd, (void *) arg, sizeof(cd))) + if (copy_from_user(&cd, argp, sizeof(cd))) return -EFAULT; return bnep_del_connection(&cd); case BNEPGETCONNLIST: - if (copy_from_user(&cl, (void *) arg, sizeof(cl))) + if (copy_from_user(&cl, argp, sizeof(cl))) return -EFAULT; if (cl.cnum <= 0) return -EINVAL; err = bnep_get_connlist(&cl); - if (!err && copy_to_user((void *) arg, &cl, sizeof(cl))) + if (!err && copy_to_user(argp, &cl, sizeof(cl))) return -EFAULT; return err; case BNEPGETCONNINFO: - if (copy_from_user(&ci, (void *) arg, sizeof(ci))) + if (copy_from_user(&ci, argp, sizeof(ci))) return -EFAULT; err = bnep_get_conninfo(&ci); - if (!err && copy_to_user((void *) arg, &ci, sizeof(ci))) + if (!err && copy_to_user(argp, &ci, sizeof(ci))) return -EFAULT; return err;