mfd: Fix kcalloc parameters swapped
authorAxel Lin <axel.lin@gmail.com>
Sun, 12 Feb 2012 09:43:22 +0000 (17:43 +0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 6 Mar 2012 17:46:43 +0000 (18:46 +0100)
The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/mfd-core.c

index 0f5922812bffdee8e3e892cab978052548d92114..9fc05b9b0bab06cd6ceac348a674d70ae676c673 100644 (file)
@@ -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;