All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] video/fbdev: Warn when we try to free a registered framebuffer
@ 2018-09-03 16:51 Chris Wilson
  2018-09-03 17:02 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
  2018-09-03 17:22 ` ✗ Fi.CI.BAT: failure " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2018-09-03 16:51 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-03 17:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 16:51 [PATCH] video/fbdev: Warn when we try to free a registered framebuffer Chris Wilson
2018-09-03 17:02 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-09-03 17:22 ` ✗ Fi.CI.BAT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.