amdgpu: fix GEM obj leak in amdgpu_display_user_framebuffer_create
Subsystems (2)
PATCH 1/1 amdgpu: fix GEM obj leak in amdgpu_display_user_framebuffer_create
This error code-path is missing a drm_gem_object_put call. Other error code-paths are fine.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -0
@@ -944,6 +944,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, domains =amdgpu_display_supported_domains (drm_to_adev (dev), bo->flags);if (obj->import_attach && !(domains &AMDGPU_GEM_DOMAIN_GTT )) {drm_dbg_kms (dev,"Cannot create framebuffer from imported dma_buf\n" ); +drm_gem_object_put (obj);return ERR_PTR (-EINVAL ); }
Signature · 6 lines
2.31.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 21.04.21 um 11:16 schrieb Simon Ser:
Quoted 2 lines
This error code-path is missing a
drm_gem_object_putcall. Other error code-paths are fine.
Good catch. For some extra points you could change the error handling into using goto error instead of hand wiring it.
Either way patch is Reviewed-by: Christian König <[email protected]>
Thanks,
Christian.
Quoted 16 lines
Signed-off-by Simon Ser <[email protected]>Fixes 1769152ac64b ("drm/amdgpu: Fail fb creation from imported dma-bufs. (v2)")Cc Alex Deucher <[email protected]>Cc Harry Wentland <[email protected]>Cc Nicholas Kazlauskas <[email protected]>Cc Bas Nieuwenhuizen <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c amdgpu_display_user_framebuffer_create(struct drm_device *dev, · line 950
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1
-0@@ -944,6 +944,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, domains =amdgpu_display_supported_domains (drm_to_adev (dev), bo->flags);if (obj->import_attach && !(domains &AMDGPU_GEM_DOMAIN_GTT )) {drm_dbg_kms (dev,"Cannot create framebuffer from imported dma_buf\n" ); +drm_gem_object_put (obj);return ERR_PTR (-EINVAL ); }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
AppliedApplied. Thanks!
Alex
Quoted 33 lines · Christian König
Am 21.04.21 um 11:16 schrieb Simon Ser:
Quoted 2 lines
This error code-path is missing a
drm_gem_object_putcall. Other error code-paths are fine.Good catch. For some extra points you could change the error handling into using goto error instead of hand wiring it.
Either way patch is Reviewed-by: Christian König <[email protected]>
Thanks,
Christian.Quoted 20 lines
Signed-off-by Simon Ser <[email protected]>Fixes 1769152ac64b ("drm/amdgpu: Fail fb creation from imported dma-bufs. (v2)")Cc Alex Deucher <[email protected]>Cc Harry Wentland <[email protected]>Cc Nicholas Kazlauskas <[email protected]>Cc Bas Nieuwenhuizen <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1
-0@@ -944,6 +944,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, domains =amdgpu_display_supported_domains (drm_to_adev (dev), bo->flags);if (obj->import_attach && !(domains &AMDGPU_GEM_DOMAIN_GTT )) {drm_dbg_kms (dev,"Cannot create framebuffer from imported dma_buf\n" ); +drm_gem_object_put (obj);
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c amdgpu_display_user_framebuffer_create(struct drm_device *dev, · line 950
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0
-0return ERR_PTR (-EINVAL ); }_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx