Fixed logic to return data back to user

Change-Id: I324d07c38e8d7eb202d4dccfed6e62006cf9cd29
Signed-off-by: Serguei Sagalovitch <Serguei.Sagalovitch@amd.com>
Этот коммит содержится в:
Serguei Sagalovitch
2016-01-22 14:37:20 -05:00
родитель 47cef87a34
Коммит f44982a7ca
2 изменённых файлов: 3 добавлений и 4 удалений
+2 -2
Просмотреть файл
@@ -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));
+1 -2
Просмотреть файл
@@ -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, &params,
sizeof(params))) {
if (copy_to_user((void *)arg, &params, sizeof(params))) {
MSG_ERR("copy_to_user failed on user pointer %p\n",
(void *)arg);