Skip to content

Commit

Permalink
[ARM] Use kcalloc to allocate counter_config array rather than kmalloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King authored and Russell King committed Mar 21, 2006
1 parent ae92dc9 commit 58e9ff5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 58e9ff5

Please sign in to comment.