diff options
| author | Alexander Viro <viro@parcelfarce.linux.theplanet.co.uk> | 2004-06-03 07:43:50 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-03 07:43:50 -0700 |
| commit | f9280acd18138f1e1e2e04d49cc9b615dd492e2e (patch) | |
| tree | 2e8f43006a2f271c577297362100ba135a50e7af | |
| parent | eb3119f9c6cac802e0f80694126495b1bb46e357 (diff) | |
[PATCH] sparse: vlan annotation
| -rw-r--r-- | include/linux/if_vlan.h | 2 | ||||
| -rw-r--r-- | net/8021q/vlan.c | 9 | ||||
| -rw-r--r-- | net/socket.c | 6 |
3 files changed, 8 insertions, 9 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 104df1877778..46d246bac3bf 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -55,7 +55,7 @@ struct vlan_hdr { #define VLAN_VID_MASK 0xfff /* found in socket.c */ -extern void vlan_ioctl_set(int (*hook)(unsigned long)); +extern void vlan_ioctl_set(int (*hook)(void __user *)); #define VLAN_NAME "vlan" diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 6203a5616b03..a44c900ac08b 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -49,7 +49,7 @@ static char vlan_copyright[] = "Ben Greear <greearb@candelatech.com>"; static char vlan_buggyright[] = "David S. Miller <davem@redhat.com>"; static int vlan_device_event(struct notifier_block *, unsigned long, void *); -static int vlan_ioctl_handler(unsigned long); +static int vlan_ioctl_handler(void __user *); static int unregister_vlan_dev(struct net_device *, unsigned short ); struct notifier_block vlan_notifier_block = { @@ -661,9 +661,9 @@ out: /* * VLAN IOCTL handler. * o execute requested action or pass command to the device driver - * arg is really a void* to a vlan_ioctl_args structure. + * arg is really a struct vlan_ioctl_args __user *. */ -static int vlan_ioctl_handler(unsigned long arg) +static int vlan_ioctl_handler(void __user *arg) { int err = 0; struct vlan_ioctl_args args; @@ -675,8 +675,7 @@ static int vlan_ioctl_handler(unsigned long arg) if (!capable(CAP_NET_ADMIN)) return -EPERM; - if (copy_from_user(&args, (void*)arg, - sizeof(struct vlan_ioctl_args))) + if (copy_from_user(&args, arg, sizeof(struct vlan_ioctl_args))) return -EFAULT; /* Null terminate this sucker, just in case. */ diff --git a/net/socket.c b/net/socket.c index a293bf13e095..b10023d9eefd 100644 --- a/net/socket.c +++ b/net/socket.c @@ -740,9 +740,9 @@ void brioctl_set(int (*hook)(unsigned int, void __user *)) EXPORT_SYMBOL(brioctl_set); static DECLARE_MUTEX(vlan_ioctl_mutex); -static int (*vlan_ioctl_hook)(unsigned long arg); +static int (*vlan_ioctl_hook)(void __user *arg); -void vlan_ioctl_set(int (*hook)(unsigned long)) +void vlan_ioctl_set(int (*hook)(void __user *)) { down(&vlan_ioctl_mutex); vlan_ioctl_hook = hook; @@ -816,7 +816,7 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd, down(&vlan_ioctl_mutex); if (vlan_ioctl_hook) - err = vlan_ioctl_hook(arg); + err = vlan_ioctl_hook(argp); up(&vlan_ioctl_mutex); break; case SIOCGIFDIVERT: |
