summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-dev.c
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2019-06-18 14:29:35 +0200
committerStefan Agner <stefan.agner@toradex.com>2019-06-18 14:29:35 +0200
commitd15d0b7a9f89cf5a905ad6802eb23100c8063939 (patch)
tree84caa660dc73842efa29e116dcb3e32aa81a5cf0 /drivers/i2c/i2c-dev.c
parente9dcc568b2e968af848bbdb4267ba6cde5457b9e (diff)
parent858848641fbecd42437e36adc9291b0ce5db379e (diff)
Merge tag 'v4.19.50-rt22' into toradex_4.19.y-rt
Linux 4.19.50-rt22
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.
*/