Skip to contentSkip to conversation

KVM: PPC: fix a sanity check

PATCH Applied Dan Carpenter 3 participants 3 messages Jul 14, 2016 – Sep 27, 2016

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

PATCH 1/1 KVM: PPC: fix a sanity check

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')
arch/powerpc/kvm/booke.c +1 -1
index 02b4672..df3f270 100644
@@ -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;