KVM: PPC: BookE: Fix a sanity check
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Jul 2016 10:15:46 +0000 (13:15 +0300)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 27 Sep 2016 05:14:29 +0000 (15:14 +1000)
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>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/booke.c

index 02b4672..df3f270 100644 (file)
@@ -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;