diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-05-10 11:40:35 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-05-10 11:40:35 -0700 |
commit | 14e0c7317ed58bcd15af5c3d09818ee0f2e3984c (patch) | |
tree | f9b63dc681574484c23c6b01be81f17cf9c64d6a /drivers/input/evdev.c | |
parent | 3a349763cf11e63534b8f2d302f2d0c790566497 (diff) | |
parent | 0981949da8f7498b96c6e0ae60680865ca283bf1 (diff) | |
download | linux-14e0c7317ed58bcd15af5c3d09818ee0f2e3984c.tar.gz |
Merge branch 'next' into for-linus
Prepare input updates for 5.2 merge window.
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r-- | drivers/input/evdev.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index f48369d6f3a0..ee8dd8b1b09e 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -503,14 +503,13 @@ static int evdev_open(struct inode *inode, struct file *file) { struct evdev *evdev = container_of(inode->i_cdev, struct evdev, cdev); unsigned int bufsize = evdev_compute_buffer_size(evdev->handle.dev); - unsigned int size = sizeof(struct evdev_client) + - bufsize * sizeof(struct input_event); struct evdev_client *client; int error; - client = kzalloc(size, GFP_KERNEL | __GFP_NOWARN); + client = kzalloc(struct_size(client, buffer, bufsize), + GFP_KERNEL | __GFP_NOWARN); if (!client) - client = vzalloc(size); + client = vzalloc(struct_size(client, buffer, bufsize)); if (!client) return -ENOMEM; |