mfd: Fix kcalloc parameters swapped
PATCH 1/1 mfd: Fix kcalloc parameters swapped
The first parameter should be "number of elements" and the second parameter should be "element size".
Signed-off-by Axel Lin <[email protected]>
--- drivers/mfd/mfd-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/mfd-core.c +1 -1
@@ -162,7 +162,7 @@ int mfd_add_devices(struct device *parent, int id,atomic_t *cnts;/* initialize reference counting for all cells */ - cnts =kcalloc (sizeof (*cnts), n_devs,GFP_KERNEL ); + cnts =kcalloc (n_devs,sizeof (*cnts),GFP_KERNEL );if (!cnts)return -ENOMEM ;
Signature · 1 line
1.7.5.4
Samuel Ortiz
AppliedHi Axel,
Quoted 4 lines · Axel Lin
The first parameter should be "number of elements" and the second parameter should be "element size".
Signed-off-by Axel Lin <[email protected]>
Applied, thanks.
Cheers,
Samuel.
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/