drm/amdkfd: fix improper return value on error
authorPan Bian <bianpan2016@163.com>
Thu, 1 Dec 2016 08:10:42 +0000 (16:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Oct 2017 08:26:05 +0000 (10:26 +0200)
commit09831a9577669fa16f4369a934e88d8ff644cfe0
tree176c9e5ac0c49efc2c7ff524747738f32cce5754
parent68b94d6c4edb74bd71d539dffc0bd0ca8a16dea4
drm/amdkfd: fix improper return value on error

[ Upstream commit 8bf793883da213864efc50c274d2b38ec0ca58b2 ]

In function kfd_wait_on_events(), when the call to copy_from_user()
fails, the value of return variable ret is 0. 0 indicates success, which
is inconsistent with the execution status. This patch fixes the bug by
assigning "-EFAULT" to ret when copy_from_user() returns an unexpected
value.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdkfd/kfd_events.c