[PATCH] video/fbdev: Warn when we try to free a registered framebuffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux