All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] KVM: PPC: fix a sanity check
@ 2016-07-14 10:15 ` Dan Carpenter
  0 siblings, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2016-07-14 10:15 UTC (permalink / raw)
  To: Alexander Graf, Bharat Bhushan
  Cc: kvm, Radim Krčmář,
	kernel-janitors, kvm-ppc, Paul Mackerras, Paolo Bonzini,
	linuxppc-dev

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] 7+ messages in thread

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

Thread overview: 7+ 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 10:15 ` Dan Carpenter
2016-07-14 10:15 ` Dan Carpenter
2016-07-14 11:10 ` Alexander Graf
2016-07-14 11:10   ` Alexander Graf
2016-09-27  5:46 ` Paul Mackerras
2016-09-27  5:46   ` Paul Mackerras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.