summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-google-hammer.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-google-hammer.c')
-rw-r--r--drivers/hid/hid-google-hammer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c
index 4c1ccf7a267a..1af477e58480 100644
--- a/drivers/hid/hid-google-hammer.c
+++ b/drivers/hid/hid-google-hammer.c
@@ -59,8 +59,7 @@ static int cbas_ec_query_base(struct cros_ec_device *ec_dev, bool get_state,
struct cros_ec_command *msg;
int ret;
- msg = kzalloc(struct_size(msg, data, max(sizeof(u32), sizeof(*params))),
- GFP_KERNEL);
+ msg = kzalloc_flex(*msg, data, max(sizeof(u32), sizeof(*params)));
if (!msg)
return -ENOMEM;