KVM: ARM/arm64: return -EFAULT if copy_from_user fails in set_timer_reg
authorWill Deacon <will.deacon@arm.com>
Tue, 26 Aug 2014 14:13:23 +0000 (15:13 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:19:13 +0000 (17:19 +0200)
commit1453b5c1052996b983f6d9ae043dec64e089c0c8
tree3c0eb5732f891999e497aeb24851089b34f3a4ec
parent563d813862bf2c44e1e9f0d59facf8e0ce303355
KVM: ARM/arm64: return -EFAULT if copy_from_user fails in set_timer_reg

We currently return the number of bytes not copied if set_timer_reg
fails, which is almost certainly not what userspace would like.

This patch returns -EFAULT 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 bd218bce92d3868ba4fe5e9e3eb8199d2aa614af)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/kvm/guest.c
arch/arm64/kvm/guest.c