diff mbox series

[2/2] Revert "drm/amd/amdgpu: fix refcount leak"

Message ID 20210728150230.150985-3-stefan.bader@canonical.com
State New
Headers show
Series Reverts we probably want to do quickly | expand

Commit Message

Stefan Bader July 28, 2021, 3:02 p.m. UTC
This reverts commit 6c0065eb69de90d50186c04f51ffe889e5bbe037. The 4.19.y
series which this patch comes from has a previous change which is not in
bionic which stores GEM info in the framebuffer. Suspecting that due to
this we actually have no refcount leak in our kernel.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Krzysztof Kozlowski July 29, 2021, 7:45 a.m. UTC | #1
On 28/07/2021 17:02, Stefan Bader wrote:
> This reverts commit 6c0065eb69de90d50186c04f51ffe889e5bbe037. The 4.19.y
> series which this patch comes from has a previous change which is not in
> bionic which stores GEM info in the framebuffer. Suspecting that due to
> this we actually have no refcount leak in our kernel.
> 

The get() happens via:
amdgpufb_create() -> amdgpu_display_gem_fb_init() ->
amdgpu_display_framebuffer_init().

The backport is a fix for 37ac3dc00da0 ("drm/amdgpu: Use device specific
BO size & stride check."), which we do not have. So obviously it's bogus
in our context and the cause of memory corruption.

However maybe we should consider backporting both - 37ac3dc00da0 and fix
reverted here... but that's different story :)

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
index cf001bb4adb6..90fa8e8bc6fb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
@@ -292,13 +292,10 @@  void amdgpu_fb_output_poll_changed(struct amdgpu_device *adev)
 static int amdgpu_fbdev_destroy(struct drm_device *dev, struct amdgpu_fbdev *rfbdev)
 {
 	struct amdgpu_framebuffer *rfb = &rfbdev->rfb;
-	int i;
 
 	drm_fb_helper_unregister_fbi(&rfbdev->helper);
 
 	if (rfb->obj) {
-		for (i = 0; i < rfb->base.format->num_planes; i++)
-			drm_gem_object_put(rfb->obj);
 		amdgpufb_destroy_pinned_object(rfb->obj);
 		rfb->obj = NULL;
 		drm_framebuffer_unregister_private(&rfb->base);