aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-dev.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <[email protected]>2019-01-15 14:20:53 +0000
committerGreg Kroah-Hartman <[email protected]>2019-01-15 14:20:53 +0000
commitbdfe0df1e97beedc15f68ee6556830548e81f63f (patch)
treeed4f0eb7acb8814642eb1fb4da0ac28704dc4fe0 /drivers/i2c/i2c-dev.c
parentdriver core: drop use of BUS_ATTR() (diff)
parentLinux 5.0-rc2 (diff)
downloadkernel-bdfe0df1e97beedc15f68ee6556830548e81f63f.tar.gz
kernel-bdfe0df1e97beedc15f68ee6556830548e81f63f.zip
Merge 5.0-rc2 into driver-core-next
We want the driver core changes in that branch in here to build on top of. Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
-rw-r--r--drivers/i2c/i2c-dev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 1aca742fde4a..ccd76c71af09 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -470,9 +470,15 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
data_arg.data);
}
case I2C_RETRIES:
+ if (arg > INT_MAX)
+ return -EINVAL;
+
client->adapter->retries = arg;
break;
case I2C_TIMEOUT:
+ if (arg > INT_MAX)
+ return -EINVAL;
+
/* For historical reasons, user-space sets the timeout
* value in units of 10 ms.
*/