Commit f9280acd authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: vlan annotation

parent eb3119f9
......@@ -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"
......
......@@ -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 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
/*
* 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. */
......
......@@ -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:
......
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