linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [patch] KVM: PPC: fix a sanity check
@ 2016-07-14 10:15 Dan Carpenter
  2016-07-14 11:10 ` Alexander Graf
  2016-09-27  5:46 ` Paul Mackerras
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-07-14 10:15 UTC (permalink / raw)
  To: Alexander Graf, Bharat Bhushan
  Cc: Paolo Bonzini, Radim Krčmář,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, kvm-ppc,
	kvm, linuxppc-dev, kernel-janitors

We use logical negate where bitwise negate was intended.  It means that
we never return -EINVAL here.

Fixes: ce11e48b7fdd ('KVM: PPC: E500: Add userspace debug stub support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 02b4672..df3f270 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -2038,7 +2038,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
 		if (type == KVMPPC_DEBUG_NONE)
 			continue;
 
-		if (type & !(KVMPPC_DEBUG_WATCH_READ |
+		if (type & ~(KVMPPC_DEBUG_WATCH_READ |
 			     KVMPPC_DEBUG_WATCH_WRITE |
 			     KVMPPC_DEBUG_BREAKPOINT))
 			return -EINVAL;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-27  5:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-14 10:15 [patch] KVM: PPC: fix a sanity check Dan Carpenter
2016-07-14 11:10 ` Alexander Graf
2016-09-27  5:46 ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).