summaryrefslogtreecommitdiff
path: root/drivers/accel
diff options
context:
space:
mode:
authorTomer Tayar <tomer.tayar@intel.com>2024-05-26 16:32:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-13 15:37:31 -0500
commit09edad3c0fbb1c22ee2ab02dabc21cd0c6d49cc8 (patch)
tree8820438494a23eab2908fe53498efae3d4ac47fa /drivers/accel
parente36fcddbaee8996c97a2d33cd7543c4a41e4bfb3 (diff)
downloadlinux-09edad3c0fbb1c22ee2ab02dabc21cd0c6d49cc8.tar.gz
linux-09edad3c0fbb1c22ee2ab02dabc21cd0c6d49cc8.tar.bz2
linux-09edad3c0fbb1c22ee2ab02dabc21cd0c6d49cc8.zip
accel/habanalabs: return ENOMEM if less than requested pages were pinned
[ Upstream commit 9f5067531c9b79318c4e48a933cb2694f53f3de2 ] EFAULT is currently returned if less than requested user pages are pinned. This value means a "bad address" which might be confusing to the user, as the address of the given user memory is not necessarily "bad". Modify the return value to ENOMEM, as "out of memory" is more suitable in this case. Signed-off-by: Tomer Tayar <tomer.tayar@intel.com> Reviewed-by: Koby Elbaz <koby.elbaz@intel.com> Signed-off-by: Koby Elbaz <koby.elbaz@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/accel')
-rw-r--r--drivers/accel/habanalabs/common/memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/accel/habanalabs/common/memory.c b/drivers/accel/habanalabs/common/memory.c
index 61472a381904..48d2d598a387 100644
--- a/drivers/accel/habanalabs/common/memory.c
+++ b/drivers/accel/habanalabs/common/memory.c
@@ -2332,7 +2332,7 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size,
if (rc < 0)
goto destroy_pages;
npages = rc;
- rc = -EFAULT;
+ rc = -ENOMEM;
goto put_pages;
}
userptr->npages = npages;