KVM: ARM/arm64: avoid returning negative error code as bool
authorWill Deacon <will.deacon@arm.com>
Tue, 26 Aug 2014 14:13:22 +0000 (15:13 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:19:12 +0000 (17:19 +0200)
commit563d813862bf2c44e1e9f0d59facf8e0ce303355
tree9060a92541e419699c784385628bfd61c73281eb
parent0251cb8ae768874a988c39a908fbcc8dfd82429a
KVM: ARM/arm64: avoid returning negative error code as bool

is_valid_cache returns true if the specified cache is valid.
Unfortunately, if the parameter passed it out of range, we return
-ENOENT, which ends up as true leading to potential hilarity.

This patch returns false on the failure path instead.

Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
(cherry picked from commit 18d457661fb9fa69352822ab98d39331c3d0e571)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/kvm/coproc.c
arch/arm64/kvm/sys_regs.c