]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: fix error handling in svm_hardware_setup
authorLi RongQing <lirongqing@baidu.com>
Sun, 23 Feb 2020 08:13:12 +0000 (16:13 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 23 Feb 2020 08:34:26 +0000 (09:34 +0100)
commitce9757fec0d255634830f2d247555e511cff47f5
treec85d23c8c6359ffc9615347224118fafa8e04aba
parent08ec97b0cdc1003806bf03724dd8ab8d9e3a35f3
KVM: fix error handling in svm_hardware_setup

rename svm_hardware_unsetup as svm_hardware_teardown, move
it before svm_hardware_setup, and call it to free all memory
if fail to setup in svm_hardware_setup, otherwise memory will
be leaked

remove __exit attribute for it since it is called in __init
function

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c