If nothing is found, error should be returned.
v2: udpate the error value different from parameter check
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
amdgpu_bo_handle *buf_handle,
uint64_t *offset_in_bo)
{
- uint32_t i;
struct amdgpu_bo *bo;
+ uint32_t i;
+ int r = 0;
if (cpu == NULL || size == 0)
return -EINVAL;
} else {
*buf_handle = NULL;
*offset_in_bo = 0;
+ r = -ENXIO;
}
pthread_mutex_unlock(&dev->bo_table_mutex);
- return 0;
+ return r;
}
int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,