]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
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>
Wed, 27 Aug 2014 20:49:45 +0000 (22:49 +0200)
commit18d457661fb9fa69352822ab98d39331c3d0e571
treecbe2377b2344fa08be3a17c610d101c85b75e225
parent4000be423cb01a8d09de878bb8184511c49d4238
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>
arch/arm/kvm/coproc.c
arch/arm64/kvm/sys_regs.c