Commit d80b64f
KVM: SVM: Fix potential memory leak in svm_cpu_init()
When kmalloc memory for sd->sev_vmcbs failed, we forget to free the page
held by sd->save_area. Also get rid of the var r as '-ENOMEM' is actually
the only possible outcome here.
Reviewed-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 23520b2 commit d80b64f
1 file changed
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1005 | 1005 | | |
1006 | 1006 | | |
1007 | 1007 | | |
1008 | | - | |
1009 | 1008 | | |
1010 | 1009 | | |
1011 | 1010 | | |
1012 | 1011 | | |
1013 | 1012 | | |
1014 | | - | |
1015 | 1013 | | |
1016 | 1014 | | |
1017 | | - | |
| 1015 | + | |
1018 | 1016 | | |
1019 | 1017 | | |
1020 | | - | |
1021 | 1018 | | |
1022 | 1019 | | |
1023 | 1020 | | |
1024 | 1021 | | |
1025 | | - | |
| 1022 | + | |
1026 | 1023 | | |
1027 | 1024 | | |
1028 | 1025 | | |
1029 | 1026 | | |
1030 | 1027 | | |
1031 | 1028 | | |
1032 | | - | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1033 | 1032 | | |
1034 | | - | |
| 1033 | + | |
1035 | 1034 | | |
1036 | 1035 | | |
1037 | 1036 | | |
| |||
0 commit comments