mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
cpufreq: sparc: change kzalloc to kcalloc
Refactor to use kcalloc instead of kzalloc when multiplying allocation size by count. This refactor prevents unintentional memory overflows. Discovered by checkpatch.pl. Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
parent
a9ba290d0b
commit
af6cc45af3
|
@ -323,7 +323,7 @@ static int __init us2e_freq_init(void)
|
||||||
impl = ((ver >> 32) & 0xffff);
|
impl = ((ver >> 32) & 0xffff);
|
||||||
|
|
||||||
if (manuf == 0x17 && impl == 0x13) {
|
if (manuf == 0x17 && impl == 0x13) {
|
||||||
us2e_freq_table = kzalloc(NR_CPUS * sizeof(*us2e_freq_table),
|
us2e_freq_table = kcalloc(NR_CPUS, sizeof(*us2e_freq_table),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!us2e_freq_table)
|
if (!us2e_freq_table)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
|
@ -171,7 +171,7 @@ static int __init us3_freq_init(void)
|
||||||
impl == CHEETAH_PLUS_IMPL ||
|
impl == CHEETAH_PLUS_IMPL ||
|
||||||
impl == JAGUAR_IMPL ||
|
impl == JAGUAR_IMPL ||
|
||||||
impl == PANTHER_IMPL)) {
|
impl == PANTHER_IMPL)) {
|
||||||
us3_freq_table = kzalloc(NR_CPUS * sizeof(*us3_freq_table),
|
us3_freq_table = kcalloc(NR_CPUS, sizeof(*us3_freq_table),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!us3_freq_table)
|
if (!us3_freq_table)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user