|
@@ -298,11 +298,14 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
|
|
|
if (!dev->max_timeout)
|
|
|
return -ENOTTY;
|
|
|
|
|
|
+ /* Check for multiply overflow */
|
|
|
+ if (val > U32_MAX / 1000)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
tmp = val * 1000;
|
|
|
|
|
|
- if (tmp < dev->min_timeout ||
|
|
|
- tmp > dev->max_timeout)
|
|
|
- return -EINVAL;
|
|
|
+ if (tmp < dev->min_timeout || tmp > dev->max_timeout)
|
|
|
+ return -EINVAL;
|
|
|
|
|
|
if (dev->s_timeout)
|
|
|
ret = dev->s_timeout(dev, tmp);
|