]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: dev: Force case user pointers in compat_i2cdev_ioctl()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 11 Apr 2022 18:07:52 +0000 (21:07 +0300)
committerWolfram Sang <wsa@kernel.org>
Fri, 15 Apr 2022 21:30:59 +0000 (23:30 +0200)
commit344c34c6f30a16095d0f029ef437590c8734e20e
treef0e322bb82a3dbd90a777e8778c58d4cc05db406
parent10bdcab2ba7ae802c46888d026f3b4b1e24ece23
i2c: dev: Force case user pointers in compat_i2cdev_ioctl()

Sparse has warned us about wrong address space for user pointers:

  i2c-dev.c:561:50: warning: incorrect type in initializer (different address spaces)
  i2c-dev.c:561:50:    expected unsigned char [usertype] *buf
  i2c-dev.c:561:50:    got void [noderef] __user *

Force cast the pointer to (__u8 *) that is used by I²C core code.

Note, this is an additional fix to the previously addressed similar issue
in the I2C_RDWR case in the same function.

Fixes: cd2d7a707856 ("i2c: dev: Add __user annotation")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/i2c-dev.c