From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs() Date: Wed, 29 Jul 2009 11:02:36 +0800 Message-ID: <200907291102.38682.sheng@linux.intel.com> References: <200907290046.40596.bzolnier@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Bartlomiej Zolnierkiewicz , Avi Kivity , linux-kernel@vger.kernel.org, Dan Carpenter , corbet@lwn.net, eteo@redhat.com, Julia Lawall To: kvm@vger.kernel.org Return-path: Received: from mga10.intel.com ([192.55.52.92]:56833 "EHLO fmsmga102.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752728AbZG2DDg (ORCPT ); Tue, 28 Jul 2009 23:03:36 -0400 In-Reply-To: <200907290046.40596.bzolnier@gmail.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Wednesday 29 July 2009 06:46:38 Bartlomiej Zolnierkiewicz wrote: > From: Bartlomiej Zolnierkiewicz > Subject: [PATCH] kvm: remove superfluous NULL pointer check in > kvm_inject_pit_timer_irqs() > > This takes care of the following entries from Dan's list: > > arch/x86/kvm/i8254.c +714 kvm_inject_pit_timer_irqs(6) warning: variable > derefenced in initializer 'vcpu' arch/x86/kvm/i8254.c +714 > kvm_inject_pit_timer_irqs(6) warning: variable derefenced before check > 'vcpu' > > Reported-by: Dan Carpenter > Cc: corbet@lwn.net > Cc: eteo@redhat.com > Cc: Julia Lawall > Signed-off-by: Bartlomiej Zolnierkiewicz > --- > arch/x86/kvm/i8254.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: b/arch/x86/kvm/i8254.c > =================================================================== > --- a/arch/x86/kvm/i8254.c > +++ b/arch/x86/kvm/i8254.c > @@ -713,7 +713,7 @@ void kvm_inject_pit_timer_irqs(struct kv > struct kvm *kvm = vcpu->kvm; > struct kvm_kpit_state *ps; > > - if (vcpu && pit) { > + if (pit) { > int inject = 0; > ps = &pit->pit_state; > Oh, follow up for the recent zero day exploit, right? :) Yes, vcpu NULL check is not necessary here. Acked-by: Sheng Yang -- regards Yang, Sheng > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html