]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
i2c: dev: Add __user annotation
authorAndreas Hecht <andreas.e.hecht@gmail.com>
Thu, 24 Jun 2021 15:25:35 +0000 (17:25 +0200)
committerWolfram Sang <wsa@kernel.org>
Thu, 24 Jun 2021 19:47:43 +0000 (21:47 +0200)
commit3265a7e6b41bae8608e7e91ac6798de5e5564164
treeb27f825fa9063d3a45c72a75adde8297f1887b5a
parent2269583753d2b8fdd3c861a516ff0cdbfcf4ef0b
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: 7d5cb45655f2 ("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>
drivers/i2c/i2c-dev.c