[PATCH 03/11] KVM: ARM/arm64: avoid returning negative error code as bool

Christoffer Dall christoffer.dall at linaro.org
Tue Aug 26 07:49:37 PDT 2014


On Tue, Aug 26, 2014 at 03:13:22PM +0100, Will Deacon wrote:
> 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 at linaro.org>
> Cc: Marc Zyngier <marc.zyngier at arm.com>
> Signed-off-by: Will Deacon <will.deacon at arm.com>

nice one!

Acked-by: Christoffer Dall <christoffer.dall at linaro.org>



More information about the linux-arm-kernel mailing list