|
@@ -544,14 +544,15 @@ vc4_cl_lookup_bos(struct drm_device *dev,
|
|
|
|
|
|
handles = drm_malloc_ab(exec->bo_count, sizeof(uint32_t));
|
|
handles = drm_malloc_ab(exec->bo_count, sizeof(uint32_t));
|
|
if (!handles) {
|
|
if (!handles) {
|
|
|
|
+ ret = -ENOMEM;
|
|
DRM_ERROR("Failed to allocate incoming GEM handles\n");
|
|
DRM_ERROR("Failed to allocate incoming GEM handles\n");
|
|
goto fail;
|
|
goto fail;
|
|
}
|
|
}
|
|
|
|
|
|
- ret = copy_from_user(handles,
|
|
|
|
- (void __user *)(uintptr_t)args->bo_handles,
|
|
|
|
- exec->bo_count * sizeof(uint32_t));
|
|
|
|
- if (ret) {
|
|
|
|
|
|
+ if (copy_from_user(handles,
|
|
|
|
+ (void __user *)(uintptr_t)args->bo_handles,
|
|
|
|
+ exec->bo_count * sizeof(uint32_t))) {
|
|
|
|
+ ret = -EFAULT;
|
|
DRM_ERROR("Failed to copy in GEM handles\n");
|
|
DRM_ERROR("Failed to copy in GEM handles\n");
|
|
goto fail;
|
|
goto fail;
|
|
}
|
|
}
|