X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Firda%2Faf_irda.c;h=6d6c65a53118a29a522dbbe02ebac806a4619c4b;hb=333b49614bac1801f614128fdcdb6346b383a0df;hp=9e56f712e45dbef9d7d15eb0219fe6e0b1be4ee7;hpb=86090fcac5e27b630656fe3d963a6b80e26dac44;p=linux-2.6.git diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 9e56f712e..6d6c65a53 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -1797,7 +1797,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) case SIOCGSTAMP: if (sk != NULL) - return sock_get_timestamp(sk, (struct timeval *)arg); + return sock_get_timestamp(sk, (struct timeval __user *)arg); return -EINVAL; case SIOCGIFADDR: @@ -1813,7 +1813,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) return -EINVAL; default: IRDA_DEBUG(1, "%s(), doing device ioctl!\n", __FUNCTION__); - return dev_ioctl(cmd, (void *) arg); + return dev_ioctl(cmd, (void __user *) arg); } /*NOTREACHED*/ @@ -1827,7 +1827,7 @@ static int irda_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) * */ static int irda_setsockopt(struct socket *sock, int level, int optname, - char *optval, int optlen) + char __user *optval, int optlen) { struct sock *sk = sock->sk; struct irda_sock *self = irda_sk(sk); @@ -1860,7 +1860,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, return -ENOMEM; /* Copy query to the driver. */ - if (copy_from_user(ias_opt, (char *)optval, optlen)) { + if (copy_from_user(ias_opt, optval, optlen)) { kfree(ias_opt); return -EFAULT; } @@ -1962,7 +1962,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, return -ENOMEM; /* Copy query to the driver. */ - if (copy_from_user(ias_opt, (char *)optval, optlen)) { + if (copy_from_user(ias_opt, optval, optlen)) { kfree(ias_opt); return -EFAULT; } @@ -2012,7 +2012,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, if (optlen < sizeof(int)) return -EINVAL; - if (get_user(opt, (int *)optval)) + if (get_user(opt, (int __user *)optval)) return -EFAULT; /* Only possible for a seqpacket service (TTP with SAR) */ @@ -2031,7 +2031,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, return -EINVAL; /* The input is really a (__u8 hints[2]), easier as an int */ - if (get_user(opt, (int *)optval)) + if (get_user(opt, (int __user *)optval)) return -EFAULT; /* Unregister any old registration */ @@ -2050,7 +2050,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, return -EINVAL; /* The input is really a (__u8 hints[2]), easier as an int */ - if (get_user(opt, (int *)optval)) + if (get_user(opt, (int __user *)optval)) return -EFAULT; /* Set the new hint mask */ @@ -2121,7 +2121,7 @@ static int irda_extract_ias_value(struct irda_ias_set *ias_opt, * Function irda_getsockopt (sock, level, optname, optval, optlen) */ static int irda_getsockopt(struct socket *sock, int level, int optname, - char *optval, int *optlen) + char __user *optval, int __user *optlen) { struct sock *sk = sock->sk; struct irda_sock *self = irda_sk(sk); @@ -2211,7 +2211,7 @@ bed: return -ENOMEM; /* Copy query to the driver. */ - if (copy_from_user((char *) ias_opt, (char *)optval, len)) { + if (copy_from_user(ias_opt, optval, len)) { kfree(ias_opt); return -EFAULT; } @@ -2245,7 +2245,7 @@ bed: } /* Copy reply to the user */ - if (copy_to_user((char *)optval, (char *) ias_opt, + if (copy_to_user(optval, ias_opt, sizeof(struct irda_ias_set))) { kfree(ias_opt); return -EFAULT; @@ -2267,7 +2267,7 @@ bed: return -ENOMEM; /* Copy query to the driver. */ - if (copy_from_user((char *) ias_opt, (char *)optval, len)) { + if (copy_from_user(ias_opt, optval, len)) { kfree(ias_opt); return -EFAULT; } @@ -2351,7 +2351,7 @@ bed: } /* Copy reply to the user */ - if (copy_to_user((char *)optval, (char *) ias_opt, + if (copy_to_user(optval, ias_opt, sizeof(struct irda_ias_set))) { kfree(ias_opt); return -EFAULT; @@ -2378,7 +2378,7 @@ bed: if (len != sizeof(int)) return -EINVAL; /* Get timeout in ms (max time we block the caller) */ - if (get_user(val, (int *)optval)) + if (get_user(val, (int __user *)optval)) return -EFAULT; /* Tell IrLMP we want to be notified */ @@ -2438,7 +2438,7 @@ bed: * If the user want more details, he should query * the whole discovery log and pick one device... */ - if (put_user(daddr, (int *)optval)) + if (put_user(daddr, (int __user *)optval)) return -EFAULT; break;