From 23a5e1fb349d80d8c0eb97644dea16d2d7cfac26 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Thu, 22 Mar 2018 17:22:57 +0200 Subject: [PATCH] drm: Make the fb refcount handover less magic MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Instead of assigning the plane->fb pointer and clearing the fb pointer to hand over the reference, let's just do it by grabbing another referece for plane->fb and let fb keep its original one. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-8-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter Reviewed-by: Maarten Lankhorst --- drivers/gpu/drm/drm_plane.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index bedceca7dd06..008f9456a5e8 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -1084,8 +1084,7 @@ retry: plane->old_fb = NULL; } else { plane->fb = fb; - /* Unref only the old framebuffer. */ - fb = NULL; + drm_framebuffer_get(fb); } out: -- 2.30.2