summaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/cap11xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/keyboard/cap11xx.c')
-rw-r--r--drivers/input/keyboard/cap11xx.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 1a1eacae3ea1..312916f99597 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -357,8 +357,7 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
}
priv = devm_kzalloc(dev,
- sizeof(*priv) +
- cap->num_channels * sizeof(priv->keycodes[0]),
+ struct_size(priv, keycodes, cap->num_channels),
GFP_KERNEL);
if (!priv)
return -ENOMEM;