Skip to contentSkip to conversation

kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs()

PATCH Applied Bartlomiej Zolnierkiewicz 3 participants 3 messages Jul 28, 2009 – Jul 29, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs()

From: Bartlomiej Zolnierkiewicz <[email protected]>
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'

---
 arch/x86/kvm/i8254.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/i8254.c +1 -1
Index: 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;
 
Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · On Wednesday 29 July 2009 06:46:38 Bartlomiej Zolnierkiewicz wrote:

From: Bartlomiej Zolnierkiewicz <[email protected]>
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'

---
 arch/x86/kvm/i8254.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/arch/x86/kvm/i8254.c
===================================================================

arch/x86/kvm/i8254.c void kvm_inject_pit_timer_irqs(struct kv · line 719

Quoted 8 lines
arch/x86/kvm/i8254.c +1 -1
@@ -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.

Signature · 2 lines
regards
Yang, Sheng
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#2 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 9 lines · Bartlomiej Zolnierkiewicz

From: Bartlomiej Zolnierkiewicz<[email protected]>
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'

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function