diff options
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
| -rw-r--r-- | drivers/i2c/i2c-dev.c | 6 |
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) | |||
| 470 | data_arg.data); | 470 | data_arg.data); |
| 471 | } | 471 | } |
| 472 | case I2C_RETRIES: | 472 | case I2C_RETRIES: |
| 473 | if (arg > INT_MAX) | ||
| 474 | return -EINVAL; | ||
| 475 | |||
| 473 | client->adapter->retries = arg; | 476 | client->adapter->retries = arg; |
| 474 | break; | 477 | break; |
| 475 | case I2C_TIMEOUT: | 478 | case I2C_TIMEOUT: |
| 479 | if (arg > INT_MAX) | ||
| 480 | return -EINVAL; | ||
| 481 | |||
| 476 | /* For historical reasons, user-space sets the timeout | 482 | /* For historical reasons, user-space sets the timeout |
| 477 | * value in units of 10 ms. | 483 | * value in units of 10 ms. |
| 478 | */ | 484 | */ |
