From: Russell King Date: Mon, 20 Mar 2006 16:52:32 +0000 (+0000) Subject: [ARM] Use kcalloc to allocate counter_config array rather than kmalloc X-Git-Tag: v2.6.17-rc1~1122^2~9 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58e9ff56382bdce340d50b6ff22c422dc617106c;p=linux-2.6 [ARM] Use kcalloc to allocate counter_config array rather than kmalloc We need this to be zero initialised. Since this is an array, use kcalloc rather than kzalloc or kmalloc. Signed-off-by: Russell King --- diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c index de72902ad0..6f833358cd 100644 --- a/arch/arm/oprofile/common.c +++ b/arch/arm/oprofile/common.c @@ -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;