summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-07-14 13:15:46 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-16 17:50:37 +0200
commit922ef422aa472612609a1a4f270318c417ab9760 (patch)
tree48c7cc9a28882846ccb4cfb163ae6096b4187b88
parentcf75ec876a0325d67d7763cf51594fb286adaf90 (diff)
downloadlinux-stable-922ef422aa472612609a1a4f270318c417ab9760.tar.gz
linux-stable-922ef422aa472612609a1a4f270318c417ab9760.tar.bz2
linux-stable-922ef422aa472612609a1a4f270318c417ab9760.zip
KVM: PPC: BookE: Fix a sanity check
commit ac0e89bb4744d3882ccd275f2416d9ce22f4e1e7 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/powerpc/kvm/booke.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 4afae695899a..eb283c5d8cf1 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;