From: Sasha Levin <sashal@kernel.org>
To: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de
Cc: airlied@gmail.com, simona@ffwll.ch,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH] drm/tests: Initialize framebuffer's filp_head in drm_test_framebuffer_free()
Date: Sat, 28 Jun 2025 10:23:08 -0400 [thread overview]
Message-ID: <20250628142308.903037-1-sashal@kernel.org> (raw)
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@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
reply other threads:[~2025-06-28 14:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250628142308.903037-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®