Fixed logic to return data back to user
Change-Id: I324d07c38e8d7eb202d4dccfed6e62006cf9cd29 Signed-off-by: Serguei Sagalovitch <Serguei.Sagalovitch@amd.com>
Этот коммит содержится в:
@@ -130,7 +130,7 @@ void run_rdma_tests(HSAuint32 Node, HsaMemoryProperties *MemoryProperty)
|
||||
|
||||
ret = ioctl(rdma_fd, AMD2P2PTEST_IOCTL_GET_PAGE_SIZE, &get_page_size);
|
||||
|
||||
if (ret < 0)
|
||||
if (ret != 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"AMD2P2PTEST_IOCTL_GET_PAGE_SIZE error (errno=%d/%s)\n",
|
||||
@@ -146,7 +146,7 @@ void run_rdma_tests(HSAuint32 Node, HsaMemoryProperties *MemoryProperty)
|
||||
|
||||
ret = ioctl(rdma_fd, AMD2P2PTEST_IOCTL_GET_PAGES, &get_cpu_ptr);
|
||||
|
||||
if (ret < 0)
|
||||
if (ret != 0)
|
||||
{
|
||||
fprintf(stderr, "AMD2P2PTEST_IOCTL_GET_PAGES error (errno=%d/%s)\n",
|
||||
ret, strerror(ret));
|
||||
|
||||
@@ -183,8 +183,7 @@ static int ioctl_get_page_size(struct file *filp, unsigned long arg)
|
||||
params.page_size = page_size;
|
||||
MSG_INFO("Page size %llx\n", params.page_size);
|
||||
|
||||
if (result && copy_to_user((void *)arg, ¶ms,
|
||||
sizeof(params))) {
|
||||
if (copy_to_user((void *)arg, ¶ms, sizeof(params))) {
|
||||
MSG_ERR("copy_to_user failed on user pointer %p\n",
|
||||
(void *)arg);
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user