]> err.no Git - linux-2.6/commitdiff
[ARM] Use kcalloc to allocate counter_config array rather than kmalloc
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Mon, 20 Mar 2006 16:52:32 +0000 (16:52 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 21 Mar 2006 23:30:02 +0000 (23:30 +0000)
We need this to be zero initialised.  Since this is an array, use kcalloc
rather than kzalloc or kmalloc.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/oprofile/common.c

index de72902ad0ca12871522ebb507b71bac314dfa25..6f833358cd0612c4c13e5d59619e86ccee2749e5 100644 (file)
@@ -140,7 +140,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
                if (ret < 0)
                        return ret;
 
-               counter_config = kmalloc(sizeof(struct op_counter_config) * spec->num_counters,
+               counter_config = kcalloc(spec->num_counters, sizeof(struct op_counter_config),
                                         GFP_KERNEL);
                if (!counter_config)
                        return -ENOMEM;