diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2023-12-11 10:16:25 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2023-12-23 07:31:29 +0200 |
commit | 971740a4c3ac2692a8adb958d5f810c47f07e9b5 (patch) | |
tree | 20fb5b7892001b3561fc28daba9bcb33f60ed020 /drivers/gpu/drm | |
parent | cb4daf271302d71a6b9a7c01bd0b6d76febd8f0c (diff) | |
download | linux-stable-971740a4c3ac2692a8adb958d5f810c47f07e9b5.tar.gz linux-stable-971740a4c3ac2692a8adb958d5f810c47f07e9b5.tar.bz2 linux-stable-971740a4c3ac2692a8adb958d5f810c47f07e9b5.zip |
drm: Warn when freeing a framebuffer that's still on a list
Sprinkle some extra WARNs around so that we might catch
premature framebuffer destruction more readily.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231211081625.25704-2-ville.syrjala@linux.intel.com
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_framebuffer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 3cc0ffc28e86..888aadb6a4ac 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -461,6 +461,7 @@ int drm_mode_rmfb(struct drm_device *dev, u32 fb_id, INIT_WORK_ONSTACK(&arg.work, drm_mode_rmfb_work_fn); INIT_LIST_HEAD(&arg.fbs); + drm_WARN_ON(dev, !list_empty(&fb->filp_head)); list_add_tail(&fb->filp_head, &arg.fbs); schedule_work(&arg.work); @@ -827,6 +828,8 @@ void drm_framebuffer_free(struct kref *kref) container_of(kref, struct drm_framebuffer, base.refcount); struct drm_device *dev = fb->dev; + drm_WARN_ON(dev, !list_empty(&fb->filp_head)); + /* * The lookup idr holds a weak reference, which has not necessarily been * removed at this point. Check for that. @@ -1119,7 +1122,7 @@ void drm_framebuffer_remove(struct drm_framebuffer *fb) dev = fb->dev; - WARN_ON(!list_empty(&fb->filp_head)); + drm_WARN_ON(dev, !list_empty(&fb->filp_head)); /* * drm ABI mandates that we remove any deleted framebuffers from active |