From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: [PATCH] KVM: Fix warning in emulator_cmpxchg_emulated Date: Thu, 8 Dec 2011 08:17:20 +0200 Message-ID: <1323325040-10548-1-git-send-email-levinsasha928@gmail.com> Cc: Sasha Levin To: kvm@vger.kernel.org, avi@redhat.com, mtosatti@redhat.com Return-path: Received: from mail-ww0-f42.google.com ([74.125.82.42]:60616 "EHLO mail-ww0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751040Ab1LHGR7 (ORCPT ); Thu, 8 Dec 2011 01:17:59 -0500 Received: by wgbds13 with SMTP id ds13so715809wgb.1 for ; Wed, 07 Dec 2011 22:17:58 -0800 (PST) Sender: kvm-owner@vger.kernel.org List-ID: Make sure 'exchanged' is initialized. Fixes the following warning: arch/x86/kvm/x86.c: In function 'emulator_cmpxchg_emulated': arch/x86/kvm/x86.c:3794:7: warning: 'exchanged' may be used uninitialized in this function Signed-off-by: Sasha Levin --- arch/x86/kvm/x86.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index eeeaf2e..9338afc 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3791,7 +3791,7 @@ static int emulator_cmpxchg_emulated(struct x86_emulate_ctxt *ctxt, gpa_t gpa; struct page *page; char *kaddr; - bool exchanged; + bool exchanged = false; /* guests cmpxchg8b have to be emulated atomically */ if (bytes > 8 || (bytes & (bytes - 1))) -- 1.7.8