Skip to content

Commit 3265a7e

Browse files
Andreas Hechtwsakernel
authored andcommitted
i2c: dev: Add __user annotation
Fix Sparse warnings: drivers/i2c/i2c-dev.c:546:19: warning: incorrect type in assignment (different address spaces) drivers/i2c/i2c-dev.c:549:53: warning: incorrect type in argument 2 (different address spaces) compat_ptr() returns a pointer tagged __user which gets assigned to a pointer missing the __user annotation. The same pointer is passed to copy_from_user() as an argument where it is expected to have the __user annotation. Fix both by adding the __user annotation to the pointer. Fixes: 7d5cb45 ("i2c compat ioctls: move to ->compat_ioctl()") Signed-off-by: Andreas Hecht <andreas.e.hecht@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 2269583 commit 3265a7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/i2c-dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ static long compat_i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned lo
526526
return put_user(funcs, (compat_ulong_t __user *)arg);
527527
case I2C_RDWR: {
528528
struct i2c_rdwr_ioctl_data32 rdwr_arg;
529-
struct i2c_msg32 *p;
529+
struct i2c_msg32 __user *p;
530530
struct i2c_msg *rdwr_pa;
531531
int i;
532532

0 commit comments

Comments
 (0)