From: Axel Lin Date: Sun, 12 Feb 2012 09:43:22 +0000 (+0800) Subject: mfd: Fix kcalloc parameters swapped X-Git-Tag: v3.4-rc1~66^2~64 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d1b5c5e2351c5d30327f77226daab21ce9ef427f;p=karo-tx-linux.git 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 Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 0f5922812bff..9fc05b9b0bab 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -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;