2012-02-12 09:43:32

by Axel Lin

[permalink] [raw]
Subject: [PATCH] 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(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 0f59228..9fc05b9 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;

--
1.7.5.4



2012-02-23 15:25:29

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH] mfd: Fix kcalloc parameters swapped

Hi Axel,

On Sun, Feb 12, 2012 at 05:43:22PM +0800, Axel Lin wrote:
> 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.

--
Intel Open Source Technology Centre
http://oss.intel.com/