mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Gong <johngong0791@gmail.com>
To: christoffer.dall@arm.com
Cc: Shengmin Gong <shengmin.gong@gmail.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Julien Thierry <julien.thierry@arm.com>,
	Jia He <hejianet@gmail.com>,
	Andre Przywara <andre.przywara@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org
Subject: [PATCH] KVM: arm64: fix potential bug
Date: Tue, 12 Mar 2019 08:32:41 +0800	[thread overview]
Message-ID: <20190312003243.6712-1-johngong0791@gmail.com> (raw)

Since intid always >= VGIC_NR_PRIVATE_IRQS, so then even vcpu == NULL,
it never return -EINVAL.

Signed-off-by: Shengmin Gong <shengmin.gong@gmail.com>
Signed-off-by: John Gong <johngong0791@gmail.com>
---
 virt/kvm/arm/vgic/vgic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c
index abd9c7352677..d3cb1ce880e2 100644
--- a/virt/kvm/arm/vgic/vgic.c
+++ b/virt/kvm/arm/vgic/vgic.c
@@ -424,7 +424,7 @@ int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int intid,
 		return ret;
 
 	vcpu = kvm_get_vcpu(kvm, cpuid);
-	if (!vcpu && intid < VGIC_NR_PRIVATE_IRQS)
+	if (!vcpu)
 		return -EINVAL;
 
 	irq = vgic_get_irq(kvm, vcpu, intid);
-- 
2.17.1


             reply	other threads:[~2019-03-12  0:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12  0:32 John Gong [this message]
2019-03-12  1:42 ` André Przywara
2019-03-12  3:15   ` Gong John
2019-03-12  9:52     ` Andre Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190312003243.6712-1-johngong0791@gmail.com \
    --to=johngong0791@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=christoffer.dall@arm.com \
    --cc=hejianet@gmail.com \
    --cc=julien.thierry@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=shengmin.gong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®