summaryrefslogtreecommitdiffstats
path: root/drivers/memory
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2018-09-25 22:19:52 +0200
committerOlof Johansson <olof@lixom.net>2018-09-25 22:19:52 +0200
commit1e25ee6d8083bb78e164d497989dc3cafda70fb8 (patch)
treeaf81865cbecb45f9e343a9b470b61f29f18595fa /drivers/memory
parentMerge tag 'soc-fsl-next-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff)
parentmemory: atmel-ebi: Use struct_size() in devm_kzalloc() (diff)
downloadlinux-1e25ee6d8083bb78e164d497989dc3cafda70fb8.tar.xz
linux-1e25ee6d8083bb78e164d497989dc3cafda70fb8.zip
Merge tag 'at91-4.20-drivers' of git://git.kernel.org/pub/scm/linux/kernel/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 <olof@lixom.net>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/atmel-ebi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index b907865d4664..c3748b414c27 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -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;