diff options
| -rw-r--r-- | arch/x86/kvm/svm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 89c4c5aa15f1..c7f1c3fd782d 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
| @@ -1226,8 +1226,7 @@ static __init int sev_hardware_setup(void) | |||
| 1226 | min_sev_asid = cpuid_edx(0x8000001F); | 1226 | min_sev_asid = cpuid_edx(0x8000001F); |
| 1227 | 1227 | ||
| 1228 | /* Initialize SEV ASID bitmap */ | 1228 | /* Initialize SEV ASID bitmap */ |
| 1229 | sev_asid_bitmap = kcalloc(BITS_TO_LONGS(max_sev_asid), | 1229 | sev_asid_bitmap = bitmap_zalloc(max_sev_asid, GFP_KERNEL); |
| 1230 | sizeof(unsigned long), GFP_KERNEL); | ||
| 1231 | if (!sev_asid_bitmap) | 1230 | if (!sev_asid_bitmap) |
| 1232 | return 1; | 1231 | return 1; |
| 1233 | 1232 | ||
| @@ -1405,7 +1404,7 @@ static __exit void svm_hardware_unsetup(void) | |||
| 1405 | int cpu; | 1404 | int cpu; |
| 1406 | 1405 | ||
| 1407 | if (svm_sev_enabled()) | 1406 | if (svm_sev_enabled()) |
| 1408 | kfree(sev_asid_bitmap); | 1407 | bitmap_free(sev_asid_bitmap); |
| 1409 | 1408 | ||
| 1410 | for_each_possible_cpu(cpu) | 1409 | for_each_possible_cpu(cpu) |
| 1411 | svm_cpu_uninit(cpu); | 1410 | svm_cpu_uninit(cpu); |
