Skip to content

Commit

Permalink
greybus: drivers/staging/greybus/module.c: no struct_size yet
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Nelson <[email protected]>
  • Loading branch information
RobertCNelson committed Jan 28, 2020
1 parent 0df1ff5 commit 05d5773
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/greybus/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
struct gb_module *module;
int i;

module = kzalloc(struct_size(module, interfaces, num_interfaces),
GFP_KERNEL);
module = kzalloc(sizeof(*module) + num_interfaces * sizeof(intf),
GFP_KERNEL);
if (!module)
return NULL;

Expand Down

0 comments on commit 05d5773

Please sign in to comment.