From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH] kvm tools: Fix segfault when failing to initialize KVM Date: Wed, 1 Feb 2012 11:28:52 +0400 Message-ID: <20120201072852.GB1924@moon> References: <1328062060-17262-1-git-send-email-levinsasha928@gmail.com> <20120201071905.GA1924@moon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Sasha Levin , mingo@elte.hu, asias.hejun@gmail.com, kvm@vger.kernel.org To: Pekka Enberg Return-path: Received: from mail-bk0-f46.google.com ([209.85.214.46]:35589 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753663Ab2BAH24 (ORCPT ); Wed, 1 Feb 2012 02:28:56 -0500 Received: by bkcjm19 with SMTP id jm19so727948bkc.19 for ; Tue, 31 Jan 2012 23:28:55 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Feb 01, 2012 at 09:26:00AM +0200, Pekka Enberg wrote: > On Wed, 1 Feb 2012, Cyrill Gorcunov wrote: > >I suspect we need something like > >--- > >tools/kvm/builtin-run.c | 5 +++++ > >tools/kvm/kvm.c | 2 +- > >2 files changed, 6 insertions(+), 1 deletion(-) > > > >Index: linux-2.6.git/tools/kvm/builtin-run.c > >=================================================================== > >--- linux-2.6.git.orig/tools/kvm/builtin-run.c > >+++ linux-2.6.git/tools/kvm/builtin-run.c > >@@ -997,6 +997,11 @@ static int kvm_cmd_run_init(int argc, co > > } > > > > kvm = kvm__init(dev, hugetlbfs_path, ram_size, guest_name); > >+ if (IS_ERR(kvm)) { > >+ r = (int)PTR_ERR(kvm); > > The cast is not needed. > Yeah, it's leftover from draft patch ;) Sasha, would you make some new version or I should create new patch? Cyrill