Skip to contentSkip to conversation

mfd: Fix kcalloc parameters swapped

PATCH Applied Axel Lin 2 participants 2 messages Feb 12, 2012 – Feb 23, 2012 Multifunction devices (MFD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mfd: Fix kcalloc parameters swapped

The first parameter should be "number of elements" and the second parameter should be "element size".

---
 drivers/mfd/mfd-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/mfd-core.c +1 -1
index 0f59228..9fc05b9 100644
@@ -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
Applied
#1 lore raw

Hi Axel,

Quoted 4 lines · Axel Lin

The first parameter should be "number of elements" and the second parameter should be "element size".

Applied, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/