* [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs()
@ 2009-07-28 22:46 Bartlomiej Zolnierkiewicz
2009-07-29 3:02 ` Sheng Yang
2009-07-29 10:03 ` Avi Kivity
0 siblings, 2 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-07-28 22:46 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm, linux-kernel, Dan Carpenter, corbet, eteo, Julia Lawall
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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 <error27@gmail.com>
Cc: corbet@lwn.net
Cc: eteo@redhat.com
Cc: Julia Lawall <julia@diku.dk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs()
2009-07-28 22:46 [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs() Bartlomiej Zolnierkiewicz
@ 2009-07-29 3:02 ` Sheng Yang
2009-07-29 10:03 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Sheng Yang @ 2009-07-29 3:02 UTC (permalink / raw)
To: kvm
Cc: Bartlomiej Zolnierkiewicz, Avi Kivity, linux-kernel,
Dan Carpenter, corbet, eteo, Julia Lawall
On Wednesday 29 July 2009 06:46:38 Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> 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 <error27@gmail.com>
> Cc: corbet@lwn.net
> Cc: eteo@redhat.com
> Cc: Julia Lawall <julia@diku.dk>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ---
> 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 <sheng@linux.intel.com>
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs()
2009-07-28 22:46 [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs() Bartlomiej Zolnierkiewicz
2009-07-29 3:02 ` Sheng Yang
@ 2009-07-29 10:03 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2009-07-29 10:03 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: kvm, linux-kernel, Dan Carpenter, corbet, eteo, Julia Lawall
On 07/29/2009 01:46 AM, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz<bzolnier@gmail.com>
> 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.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-29 9:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-28 22:46 [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs() Bartlomiej Zolnierkiewicz
2009-07-29 3:02 ` Sheng Yang
2009-07-29 10:03 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox