diff options
Diffstat (limited to 'arch/i386/kernel/cpu/intel_cacheinfo.c')
-rw-r--r-- | arch/i386/kernel/cpu/intel_cacheinfo.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c index 5c43be47587f..80b4c5d421b1 100644 --- a/arch/i386/kernel/cpu/intel_cacheinfo.c +++ b/arch/i386/kernel/cpu/intel_cacheinfo.c | |||
@@ -480,12 +480,10 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) | |||
480 | if (num_cache_leaves == 0) | 480 | if (num_cache_leaves == 0) |
481 | return -ENOENT; | 481 | return -ENOENT; |
482 | 482 | ||
483 | cpuid4_info[cpu] = kmalloc( | 483 | cpuid4_info[cpu] = kzalloc( |
484 | sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); | 484 | sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); |
485 | if (unlikely(cpuid4_info[cpu] == NULL)) | 485 | if (unlikely(cpuid4_info[cpu] == NULL)) |
486 | return -ENOMEM; | 486 | return -ENOMEM; |
487 | memset(cpuid4_info[cpu], 0, | ||
488 | sizeof(struct _cpuid4_info) * num_cache_leaves); | ||
489 | 487 | ||
490 | oldmask = current->cpus_allowed; | 488 | oldmask = current->cpus_allowed; |
491 | retval = set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 489 | retval = set_cpus_allowed(current, cpumask_of_cpu(cpu)); |
@@ -658,17 +656,14 @@ static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu) | |||
658 | return -ENOENT; | 656 | return -ENOENT; |
659 | 657 | ||
660 | /* Allocate all required memory */ | 658 | /* Allocate all required memory */ |
661 | cache_kobject[cpu] = kmalloc(sizeof(struct kobject), GFP_KERNEL); | 659 | cache_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL); |
662 | if (unlikely(cache_kobject[cpu] == NULL)) | 660 | if (unlikely(cache_kobject[cpu] == NULL)) |
663 | goto err_out; | 661 | goto err_out; |
664 | memset(cache_kobject[cpu], 0, sizeof(struct kobject)); | ||
665 | 662 | ||
666 | index_kobject[cpu] = kmalloc( | 663 | index_kobject[cpu] = kzalloc( |
667 | sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL); | 664 | sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL); |
668 | if (unlikely(index_kobject[cpu] == NULL)) | 665 | if (unlikely(index_kobject[cpu] == NULL)) |
669 | goto err_out; | 666 | goto err_out; |
670 | memset(index_kobject[cpu], 0, | ||
671 | sizeof(struct _index_kobject) * num_cache_leaves); | ||
672 | 667 | ||
673 | return 0; | 668 | return 0; |
674 | 669 | ||