drm/amdgpu: fix error handling in amdgpu_bo_list_get()
Subsystems (2)
PATCH 1/2 drm/amdgpu: fix error handling in amdgpu_bo_list_get()
We should not leak the pointer where we couldn't grab the reference on to the caller because it can be that the error handling still tries to put the reference then.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +1 -0
@@ -168,6 +168,7 @@ int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id, }rcu_read_unlock (); + *result =NULL ;return -ENOENT ; }
Signature · 1 line
2.34.1
PATCH 2/2 drm/amdgpu: lower CS errors to debug severity
Otherwise userspace can spam the logs by using incorrect input values.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1 -1
@@ -1442,7 +1442,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)if (r == -ENOMEM )DRM_ERROR ("Not enough memory for command submission!\n" );else if (r != -ERESTARTSYS && r != -EAGAIN ) -DRM_ERROR ("Failed to process the buffer list %d!\n" , r); +DRM_DEBUG ("Failed to process the buffer list %d!\n" , r); goto error_fini; }
Signature · 1 line
2.34.1