Skip to content

Commit

Permalink
Merge tag 'at91-4.20-drivers' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/at91/linux into next/drivers

AT91 drivers for 4.20

 - use struct_size in atmel-ebi

* tag 'at91-4.20-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  memory: atmel-ebi: Use struct_size() in devm_kzalloc()

Signed-off-by: Olof Johansson <[email protected]>
  • Loading branch information
olofj committed Sep 25, 2018
2 parents 2e07bdf + f62df67 commit 1e25ee6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/memory/atmel-ebi.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
return -EINVAL;
}

ebid = devm_kzalloc(ebi->dev,
sizeof(*ebid) + (numcs * sizeof(*ebid->configs)),
ebid = devm_kzalloc(ebi->dev, struct_size(ebid, configs, numcs),
GFP_KERNEL);
if (!ebid)
return -ENOMEM;
Expand Down

0 comments on commit 1e25ee6

Please sign in to comment.