public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH] video/fbdev: Warn when we try to free a registered framebuffer
Date: Mon,  3 Sep 2018 17:51:59 +0100	[thread overview]
Message-ID: <20180903165159.5534-1-chris@chris-wilson.co.uk> (raw)

Just a tool for CI to emit the stacktrace of who is lost track of their
framebuffers and tried to free it before unregistering it.

References: https://bugs.freedesktop.org/show_bug.cgi?id=107712
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
Would be useful to keep in core-for-CI as a debug aide.
---
 drivers/video/fbdev/core/fbsysfs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c
index e31a182b42bf..de3afba984c7 100644
--- a/drivers/video/fbdev/core/fbsysfs.c
+++ b/drivers/video/fbdev/core/fbsysfs.c
@@ -83,6 +83,11 @@ void framebuffer_release(struct fb_info *info)
 {
 	if (!info)
 		return;
+
+	if (WARN(atomic_read(&info->count),
+		 "framebuffer is still registered, leaking fb_info!\n"))
+		return;
+
 	kfree(info->apertures);
 	kfree(info);
 }
-- 
2.19.0.rc1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2018-09-03 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03 16:51 Chris Wilson [this message]
2018-09-03 17:02 ` ✗ Fi.CI.CHECKPATCH: warning for video/fbdev: Warn when we try to free a registered framebuffer Patchwork
2018-09-03 17:22 ` ✗ Fi.CI.BAT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180903165159.5534-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox