diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-08-12 18:46:07 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-08-12 18:46:07 +0200 |
| commit | 0c80bdfc9aa624b4a6c33c30ad11e81bf6407c36 (patch) | |
| tree | caea5044f1bd46b56c9894a23c629ef4bf93a5ce /drivers/input/input-mt.c | |
| parent | bfa54a793ba77ef696755b66f3ac4ed00c7d1248 (diff) | |
| parent | 7c626ce4bae1ac14f60076d00eafe71af30450ba (diff) | |
Merge 6.11-rc3 into driver-core-next
We need the driver core fixes in here as well to build on top of.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/input/input-mt.c')
| -rw-r--r-- | drivers/input/input-mt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 14b53dac1253..6b04a674f832 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -46,6 +46,9 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, return 0; if (mt) return mt->num_slots != num_slots ? -EINVAL : 0; + /* Arbitrary limit for avoiding too large memory allocation. */ + if (num_slots > 1024) + return -EINVAL; mt = kzalloc(struct_size(mt, slots, num_slots), GFP_KERNEL); if (!mt) |
