Skip to content

Commit 9f50675

Browse files
Tomer TayarKobyElbaz
authored andcommitted
accel/habanalabs: return ENOMEM if less than requested pages were pinned
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>
1 parent 342f141 commit 9f50675

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/accel/habanalabs/common/memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,7 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size,
23322332
if (rc < 0)
23332333
goto destroy_pages;
23342334
npages = rc;
2335-
rc = -EFAULT;
2335+
rc = -ENOMEM;
23362336
goto put_pages;
23372337
}
23382338
userptr->npages = npages;

0 commit comments

Comments
 (0)