diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:14:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:14:24 +0000 |
commit | 2a52f25b89f9c781d2c12d014354226ea2c13598 (patch) | |
tree | b80137d1aa25be55602c98b5388327ab874bd1af /drivers/input | |
parent | Adding debian version 6.9.8-1. (diff) | |
download | linux-2a52f25b89f9c781d2c12d014354226ea2c13598.tar.xz linux-2a52f25b89f9c781d2c12d014354226ea2c13598.zip |
Merging upstream version 6.9.9.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/ff-core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c index 16231fe080..609a5f0176 100644 --- a/drivers/input/ff-core.c +++ b/drivers/input/ff-core.c @@ -9,8 +9,10 @@ /* #define DEBUG */ #include <linux/input.h> +#include <linux/limits.h> #include <linux/module.h> #include <linux/mutex.h> +#include <linux/overflow.h> #include <linux/sched.h> #include <linux/slab.h> @@ -315,9 +317,8 @@ int input_ff_create(struct input_dev *dev, unsigned int max_effects) return -EINVAL; } - ff_dev_size = sizeof(struct ff_device) + - max_effects * sizeof(struct file *); - if (ff_dev_size < max_effects) /* overflow */ + ff_dev_size = struct_size(ff, effect_owners, max_effects); + if (ff_dev_size == SIZE_MAX) /* overflow */ return -EINVAL; ff = kzalloc(ff_dev_size, GFP_KERNEL); |