X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=blobdiff_plain;f=drivers%2Finput%2Fevdev.c;h=d1e25aba8212ad3c19f66bbd704835406e78d065;hp=f040d8881ff2a2db34d56a816026e69524239f3b;hb=0aed4b28187078565cafbfe86b62f941d580d840;hpb=d3511f53bb2475f2a4e8460bee5a1ae6dea2a433 diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index f040d8881ff2..d1e25aba8212 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;