Commit 65b61787 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] misc __user annotations

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ea87cd7a
...@@ -952,11 +952,11 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc) ...@@ -952,11 +952,11 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
case OSD_SetPalette: case OSD_SetPalette:
{ {
if (FW_VERSION(av7110->arm_app) >= 0x2618) { if (FW_VERSION(av7110->arm_app) >= 0x2618) {
ret = OSDSetPalette(av7110, (u32 *)dc->data, dc->color, dc->x0); ret = OSDSetPalette(av7110, dc->data, dc->color, dc->x0);
goto out; goto out;
} else { } else {
int i, len = dc->x0-dc->color+1; int i, len = dc->x0-dc->color+1;
u8 *colors = (u8 *)dc->data; u8 __user *colors = dc->data;
u8 r, g, b, blend; u8 r, g, b, blend;
for (i = 0; i<len; i++) { for (i = 0; i<len; i++) {
......
...@@ -721,7 +721,7 @@ static int mpeg_release(struct inode *inode, struct file *file) ...@@ -721,7 +721,7 @@ static int mpeg_release(struct inode *inode, struct file *file)
} }
static ssize_t static ssize_t
mpeg_read(struct file *file, char *data, size_t count, loff_t *ppos) mpeg_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
{ {
struct cx8802_fh *fh = file->private_data; struct cx8802_fh *fh = file->private_data;
......
...@@ -1002,7 +1002,7 @@ static int video_open(struct inode *inode, struct file *file) ...@@ -1002,7 +1002,7 @@ static int video_open(struct inode *inode, struct file *file)
} }
static ssize_t static ssize_t
video_read(struct file *file, char *data, size_t count, loff_t *ppos) video_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
{ {
struct cx8800_fh *fh = file->private_data; struct cx8800_fh *fh = file->private_data;
......
...@@ -155,7 +155,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, ...@@ -155,7 +155,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
case EXT3_IOC_GETRSVSZ: case EXT3_IOC_GETRSVSZ:
if (test_opt(inode->i_sb, RESERVATION) && S_ISREG(inode->i_mode)) { if (test_opt(inode->i_sb, RESERVATION) && S_ISREG(inode->i_mode)) {
rsv_window_size = atomic_read(&ei->i_rsv_window.rsv_goal_size); rsv_window_size = atomic_read(&ei->i_rsv_window.rsv_goal_size);
return put_user(rsv_window_size, (int *)arg); return put_user(rsv_window_size, (int __user *)arg);
} }
return -ENOTTY; return -ENOTTY;
case EXT3_IOC_SETRSVSZ: case EXT3_IOC_SETRSVSZ:
...@@ -168,7 +168,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, ...@@ -168,7 +168,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
return -EACCES; return -EACCES;
if (get_user(rsv_window_size, (int *)arg)) if (get_user(rsv_window_size, (int __user *)arg))
return -EFAULT; return -EFAULT;
if (rsv_window_size > EXT3_MAX_RESERVE_BLOCKS) if (rsv_window_size > EXT3_MAX_RESERVE_BLOCKS)
...@@ -186,7 +186,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, ...@@ -186,7 +186,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
if (IS_RDONLY(inode)) if (IS_RDONLY(inode))
return -EROFS; return -EROFS;
if (get_user(n_blocks_count, (__u32 *)arg)) if (get_user(n_blocks_count, (__u32 __user *)arg))
return -EFAULT; return -EFAULT;
err = ext3_group_extend(sb, EXT3_SB(sb)->s_es, n_blocks_count); err = ext3_group_extend(sb, EXT3_SB(sb)->s_es, n_blocks_count);
...@@ -207,7 +207,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, ...@@ -207,7 +207,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
if (IS_RDONLY(inode)) if (IS_RDONLY(inode))
return -EROFS; return -EROFS;
if (copy_from_user(&input, (struct ext3_new_group_input *)arg, if (copy_from_user(&input, (struct ext3_new_group_input __user *)arg,
sizeof(input))) sizeof(input)))
return -EFAULT; return -EFAULT;
......
...@@ -743,7 +743,7 @@ static int vlan_ioctl_handler(void __user *arg) ...@@ -743,7 +743,7 @@ static int vlan_ioctl_handler(void __user *arg)
break; break;
case GET_VLAN_REALDEV_NAME_CMD: case GET_VLAN_REALDEV_NAME_CMD:
err = vlan_dev_get_realdev_name(args.device1, args.u.device2); err = vlan_dev_get_realdev_name(args.device1, args.u.device2);
if (copy_to_user((void*)arg, &args, if (copy_to_user(arg, &args,
sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) {
err = -EFAULT; err = -EFAULT;
} }
...@@ -752,7 +752,7 @@ static int vlan_ioctl_handler(void __user *arg) ...@@ -752,7 +752,7 @@ static int vlan_ioctl_handler(void __user *arg)
case GET_VLAN_VID_CMD: case GET_VLAN_VID_CMD:
err = vlan_dev_get_vid(args.device1, &vid); err = vlan_dev_get_vid(args.device1, &vid);
args.u.VID = vid; args.u.VID = vid;
if (copy_to_user((void*)arg, &args, if (copy_to_user(arg, &args,
sizeof(struct vlan_ioctl_args))) { sizeof(struct vlan_ioctl_args))) {
err = -EFAULT; err = -EFAULT;
} }
......
...@@ -479,7 +479,7 @@ static int svc_setsockopt(struct socket *sock, int level, int optname, ...@@ -479,7 +479,7 @@ static int svc_setsockopt(struct socket *sock, int level, int optname,
error = -EINVAL; error = -EINVAL;
goto out; goto out;
} }
if (get_user(value, (int *) optval)) { if (get_user(value, (int __user *) optval)) {
error = -EFAULT; error = -EFAULT;
goto out; goto out;
} }
...@@ -597,14 +597,14 @@ static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -597,14 +597,14 @@ static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case ATM_ADDPARTY: case ATM_ADDPARTY:
if (!test_bit(ATM_VF_SESSION, &vcc->flags)) if (!test_bit(ATM_VF_SESSION, &vcc->flags))
return -EINVAL; return -EINVAL;
if (copy_from_user(&sa, (void *) arg, sizeof(sa))) if (copy_from_user(&sa, (void __user *) arg, sizeof(sa)))
return -EFAULT; return -EFAULT;
error = svc_addparty(sock, (struct sockaddr *) &sa, sizeof(sa), 0); error = svc_addparty(sock, (struct sockaddr *) &sa, sizeof(sa), 0);
break; break;
case ATM_DROPPARTY: case ATM_DROPPARTY:
if (!test_bit(ATM_VF_SESSION, &vcc->flags)) if (!test_bit(ATM_VF_SESSION, &vcc->flags))
return -EINVAL; return -EINVAL;
if (copy_from_user(&ep_ref, (void *) arg, sizeof(int))) if (copy_from_user(&ep_ref, (void __user *) arg, sizeof(int)))
return -EFAULT; return -EFAULT;
error = svc_dropparty(sock, ep_ref); error = svc_dropparty(sock, ep_ref);
break; break;
......
...@@ -664,7 +664,7 @@ static int clusterip_proc_release(struct inode *inode, struct file *file) ...@@ -664,7 +664,7 @@ static int clusterip_proc_release(struct inode *inode, struct file *file)
return ret; return ret;
} }
static ssize_t clusterip_proc_write(struct file *file, const char *input, static ssize_t clusterip_proc_write(struct file *file, const char __user *input,
size_t size, loff_t *ofs) size_t size, loff_t *ofs)
{ {
#define PROC_WRITELEN 10 #define PROC_WRITELEN 10
......
...@@ -127,7 +127,7 @@ static int get_mixer_levels(void __user * arg) ...@@ -127,7 +127,7 @@ static int get_mixer_levels(void __user * arg)
{ {
int n; int n;
if (__get_user(n, (int __user *)(&(((mixer_vol_table *__user )arg)->num)))) if (__get_user(n, (int __user *)(&(((mixer_vol_table __user *)arg)->num))))
return -EFAULT; return -EFAULT;
if (n < 0 || n >= num_mixer_volumes) if (n < 0 || n >= num_mixer_volumes)
return -EINVAL; return -EINVAL;
......
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