kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm tools: Fix segfault when failing to initialize KVM
@ 2012-02-01  2:07 Sasha Levin
  2012-02-01  7:05 ` Pekka Enberg
  0 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2012-02-01  2:07 UTC (permalink / raw)
  To: penberg; +Cc: mingo, gorcunov, asias.hejun, kvm, Sasha Levin

Might happen when hardware virtualization is not supported.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/builtin-run.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index 6ded1d2..a67faf8 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -997,6 +997,10 @@ static int kvm_cmd_run_init(int argc, const char **argv)
 	}
 
 	kvm = kvm__init(dev, hugetlbfs_path, ram_size, guest_name);
+	if (IS_ERR_OR_NULL(kvm)) {
+		r = PTR_ERR(kvm);
+		goto fail;
+	}
 
 	kvm->single_step = single_step;
 
-- 
1.7.8.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-02-01 12:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01  2:07 [PATCH] kvm tools: Fix segfault when failing to initialize KVM Sasha Levin
2012-02-01  7:05 ` Pekka Enberg
2012-02-01  7:19   ` Cyrill Gorcunov
2012-02-01  7:26     ` Pekka Enberg
2012-02-01  7:28       ` Cyrill Gorcunov
2012-02-01 12:48   ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).