Skip to content
Commit d648dbf5 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Will Deacon
Browse files

kvm tool: Don't close not yet opened files and SIGSEV fix



In case if there error happened in kvm__init and we have
no files opened -- we should not try to close them.

Also once kvm failed to init the caller should not try
to dereference a pointer obtained, otherwise we might get
SIGSEV

 | [cyrill@moon kvm]$ ./lkvm run ...
 | Error: '/dev/kvm' not found. Please make sure your kernel has CONFIG_KVM
 | enabled and that the KVM modules are loaded.
 | Segmentation fault (core dumped)
 | [cyrill@moon kvm]$

Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent dfb2e458
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment