Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "A few new drivers: - driver for Azoteq IQS550/572/525 touch controllers - driver for Microchip AT42QT1050 keys - driver for GPIO controllable vibrators - support for GT5663 in Goodix driver ... along with miscellaneous driver fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: libps2 - mark expected switch fall-through Input: qt1050 - add Microchip AT42QT1050 support Input: add support for Azoteq IQS550/572/525 Input: add a driver for GPIO controllable vibrators Input: synaptics-rmi4 - fix enum_fmt Input: synaptics-rmi4 - fill initial format HID: input: add mapping for KEY_KBD_LAYOUT_NEXT Input: add KEY_KBD_LAYOUT_NEXT Input: hyperv-keyboard - add module description Input: olpc_apsp - depend on ARCH_MMP Input: sun4i-a10-lradc-keys - add support for A83T Input: snvs_pwrkey - use dev_pm_set_wake_irq() to simplify code Input: lpc32xx-key - add clocks property and fix DT binding example Input: i8042 - signal wakeup from atkbd/psmouse Input: goodix - add GT5663 CTP support Input: goodix - add regulators suppot Input: evdev - use struct_size() in kzalloc() and vzalloc() Input: edt-ft5x06 - convert to use SPDX identifier Input: edt-ft5x06 - enable ACPI enumeration
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user