summaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/mcs_touchkey.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2019-03-04 08:14:44 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-03-04 08:14:44 +0100
commit65e91e2845b5b8965f21a856e1e0ad70c6522ce7 (patch)
tree61b1c7e22270297690f02e0c169e917a27304aef /drivers/input/keyboard/mcs_touchkey.c
parentInput: elan_i2c - add ACPI ID for touchpad in Lenovo V330-15ISK (diff)
parentInput: ti_am335x_tsc - remove set but not used variable 'tscadc_dev' (diff)
downloadlinux-65e91e2845b5b8965f21a856e1e0ad70c6522ce7.tar.xz
linux-65e91e2845b5b8965f21a856e1e0ad70c6522ce7.zip
Merge branch 'next' into for-linus
Prepare input updates for 5.1 merge window.
Diffstat (limited to 'drivers/input/keyboard/mcs_touchkey.c')
-rw-r--r--drivers/input/keyboard/mcs_touchkey.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/input/keyboard/mcs_touchkey.c b/drivers/input/keyboard/mcs_touchkey.c
index be56d4f262a7..b132662201a4 100644
--- a/drivers/input/keyboard/mcs_touchkey.c
+++ b/drivers/input/keyboard/mcs_touchkey.c
@@ -113,9 +113,8 @@ static int mcs_touchkey_probe(struct i2c_client *client,
return -EINVAL;
}
- data = kzalloc(sizeof(struct mcs_touchkey_data) +
- sizeof(data->keycodes[0]) * (pdata->key_maxval + 1),
- GFP_KERNEL);
+ data = kzalloc(struct_size(data, keycodes, pdata->key_maxval + 1),
+ GFP_KERNEL);
input_dev = input_allocate_device();
if (!data || !input_dev) {
dev_err(&client->dev, "Failed to allocate memory\n");