Commit 1e9188c2 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: mroute annotation

parent d75b0fd4
...@@ -130,7 +130,7 @@ struct igmpmsg ...@@ -130,7 +130,7 @@ struct igmpmsg
extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int);
extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
extern int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg); extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
extern void ip_mr_init(void); extern void ip_mr_init(void);
......
...@@ -1008,7 +1008,7 @@ int ip_mroute_getsockopt(struct sock *sk,int optname,char __user *optval,int __u ...@@ -1008,7 +1008,7 @@ int ip_mroute_getsockopt(struct sock *sk,int optname,char __user *optval,int __u
* The IP multicast ioctl support routines. * The IP multicast ioctl support routines.
*/ */
int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg) int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg)
{ {
struct sioc_sg_req sr; struct sioc_sg_req sr;
struct sioc_vif_req vr; struct sioc_vif_req vr;
...@@ -1018,7 +1018,7 @@ int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg) ...@@ -1018,7 +1018,7 @@ int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg)
switch(cmd) switch(cmd)
{ {
case SIOCGETVIFCNT: case SIOCGETVIFCNT:
if (copy_from_user(&vr,(void *)arg,sizeof(vr))) if (copy_from_user(&vr,arg,sizeof(vr)))
return -EFAULT; return -EFAULT;
if(vr.vifi>=maxvif) if(vr.vifi>=maxvif)
return -EINVAL; return -EINVAL;
...@@ -1031,14 +1031,14 @@ int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg) ...@@ -1031,14 +1031,14 @@ int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg)
vr.obytes=vif->bytes_out; vr.obytes=vif->bytes_out;
read_unlock(&mrt_lock); read_unlock(&mrt_lock);
if (copy_to_user((void *)arg,&vr,sizeof(vr))) if (copy_to_user(arg,&vr,sizeof(vr)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
read_unlock(&mrt_lock); read_unlock(&mrt_lock);
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
case SIOCGETSGCNT: case SIOCGETSGCNT:
if (copy_from_user(&sr,(void *)arg,sizeof(sr))) if (copy_from_user(&sr,arg,sizeof(sr)))
return -EFAULT; return -EFAULT;
read_lock(&mrt_lock); read_lock(&mrt_lock);
...@@ -1049,7 +1049,7 @@ int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg) ...@@ -1049,7 +1049,7 @@ int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg)
sr.wrong_if = c->mfc_un.res.wrong_if; sr.wrong_if = c->mfc_un.res.wrong_if;
read_unlock(&mrt_lock); read_unlock(&mrt_lock);
if (copy_to_user((void *)arg,&sr,sizeof(sr))) if (copy_to_user(arg,&sr,sizeof(sr)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
......
...@@ -647,7 +647,7 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg) ...@@ -647,7 +647,7 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
default: default:
#ifdef CONFIG_IP_MROUTE #ifdef CONFIG_IP_MROUTE
return ipmr_ioctl(sk, cmd, arg); return ipmr_ioctl(sk, cmd, (void __user *)arg);
#else #else
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
#endif #endif
......
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