[PATCH] drm/tests: Initialize framebuffer's filp_head in drm_test_framebuffer_free()
Sasha Levin
sashal at kernel.org
Sat Jun 28 14:23:08 UTC 2025
The drm_test_framebuffer_free() test creates a framebuffer on the stack
without properly initializing the filp_head list, causing the following
warning when drm_framebuffer_free() checks it:
[ 144.996969] drm-kunit-mock-device drm_test_framebuffer_free.drm-kunit-mock-device: [drm] drm_WARN_ON(\!list_empty(&fb->filp_head))
[ 144.997097] WARNING: CPU: 0 PID: 2546 at drivers/gpu/drm/drm_framebuffer.c:832 drm_framebuffer_free+0x13f/0x1c0
The test intentionally creates a partially initialized framebuffer
to test an edge case in drm_framebuffer_free(), but it needs to
initialize the filp_head list to avoid triggering the warning on
uninitialized list data.
Initialize the filp_head list in the test to match the behavior of
drm_framebuffer_init().
Fixes: d21942560499 ("drm/tests: Add test for drm_framebuffer_free()")
Signed-off-by: Sasha Levin <sashal at kernel.org>
---
drivers/gpu/drm/tests/drm_framebuffer_test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/tests/drm_framebuffer_test.c b/drivers/gpu/drm/tests/drm_framebuffer_test.c
index 6ea04cc8f3241..81a7f2cfb8ed6 100644
--- a/drivers/gpu/drm/tests/drm_framebuffer_test.c
+++ b/drivers/gpu/drm/tests/drm_framebuffer_test.c
@@ -677,6 +677,7 @@ static void drm_test_framebuffer_free(struct kunit *test)
};
int id, ret;
+ INIT_LIST_HEAD(&fb.filp_head);
priv->buffer_freed = false;
/*
--
2.39.5
More information about the dri-devel
mailing list