From: sashiko-bot@kernel.org
To: "Thomas Zimmermann" <tzimmermann@suse.de>
Cc: gary@garyguo.net, wsa+renesas@sang-engineering.com,
imx@lists.linux.dev, "Eugenio Perez" <eperezma@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Frank.Li@kernel.org, virtualization@lists.linux.dev,
ojeda@kernel.org, intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
linux-hyperv@vger.kernel.org
Subject: Re: [PATCH v4 04/14] drm/panic: Return errno codes if panic output fails
Date: Wed, 09 Sep 2026 09:13:26 +0000 [thread overview]
Message-ID: <20260909091326.EB2501F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909085826.64529-5-tzimmermann@suse.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Memory leak on test failure due to KUNIT_ASSERT_EQ aborting the test without cleanup.
--
commit 9d8cd66dd2ff7109b373380125b5d333a64fb982
Author: Thomas Zimmermann <tzimmermann@suse.de>
drm/panic: Return errno codes if panic output fails
This commit modifies the panic output helpers to return errno codes, allowing
detection of invalid panic handling and avoiding display flushes on error.
The KUnit tests are also updated to assert that these new return values
indicate success.
> diff --git a/drivers/gpu/drm/tests/drm_panic_test.c b/drivers/gpu/drm/tests/drm_panic_test.c
> index ad2f3a2f93b6a..fdd77b0cc54c9 100644
> --- a/drivers/gpu/drm/tests/drm_panic_test.c
> +++ b/drivers/gpu/drm/tests/drm_panic_test.c
[ ... ]
> @@ -102,7 +102,8 @@ static void drm_test_panic_screen_user_map(struct kunit *test)
> sb->height = params->height;
> sb->pitch[0] = params->width * sb->format->cpp[0];
>
> - params->draw_screen(sb);
> + ret = params->draw_screen(sb);
> + KUNIT_ASSERT_EQ(test, ret, 0);
[Severity: Low]
If KUNIT_ASSERT_EQ() fails here, does this abort the test and bypass the
subsequent vfree(fb) cleanup step?
If draw_screen() returns a non-zero error code (for instance, due to an
unsupported size or missing font), it looks like this will leak the vmalloc'd
framebuffer since the test aborts before the free can execute.
> for (i = 0; i < fb_size; i++)
> drm_panic_check_color_byte(test, fb[i]);
[ ... ]
> @@ -146,7 +147,8 @@ static void drm_test_panic_screen_user_page(struct kunit *test)
> sb->height = params->height;
> sb->pitch[0] = params->width * sb->format->cpp[0];
>
> - params->draw_screen(sb);
> + ret = params->draw_screen(sb);
> + KUNIT_ASSERT_EQ(test, ret, 0);
[Severity: Low]
Similarly, if KUNIT_ASSERT_EQ() fails here, does it abort the test and
bypass the free_pages cleanup block?
It appears this would cause a leak of both the allocated pages and the pages
pointer array on test failure.
> for (p = 0; p < npages; p++) {
> int bytes_in_page = (p == npages - 1) ? fb_size - p * PAGE_SIZE : PAGE_SIZE;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909085826.64529-1-tzimmermann@suse.de?part=4
next prev parent reply other threads:[~2026-09-09 9:13 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 8:55 [PATCH v4 00/14] drm/panic: Split into core and helpers Thomas Zimmermann
2026-09-09 8:55 ` [PATCH v4 01/14] drm/panic: Do not use un-escaped URL as format string Thomas Zimmermann
2026-09-09 9:09 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 02/14] drm/panic: Test address from kmap op for NULL Thomas Zimmermann
2026-09-09 9:15 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 03/14] drm/panic: Return -EINVAL if font is not available Thomas Zimmermann
2026-09-09 9:08 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 04/14] drm/panic: Return errno codes if panic output fails Thomas Zimmermann
2026-09-09 9:13 ` sashiko-bot [this message]
2026-09-09 8:55 ` [PATCH v4 05/14] drm/panic: Pass colors to draw_panic_dispatch() Thomas Zimmermann
2026-09-09 9:13 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 06/14] drm/panic: Pass global module parameters to drm_panic_dispatch() Thomas Zimmermann
2026-09-09 9:22 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 07/14] drm/panic: Return from screen_user if display is too small Thomas Zimmermann
2026-09-09 9:18 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 08/14] drm/panic: Retry in dispatch function if panic output fails Thomas Zimmermann
2026-09-09 9:17 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 09/14] drm/panic: Split draw_panic_plane() Thomas Zimmermann
2026-09-09 9:20 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 10/14] drm/panic: Restrict to primary planes Thomas Zimmermann
2026-09-09 9:22 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 11/14] drm/panic: Display panic screen via per-plane callback Thomas Zimmermann
2026-09-09 9:29 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 12/14] drm/panic: Internalize panic locking in DRM core and helpers Thomas Zimmermann
2026-09-09 9:28 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 13/14] drm/panic: Move panic display code into helper library Thomas Zimmermann
2026-09-09 9:32 ` sashiko-bot
2026-09-09 8:55 ` [PATCH v4 14/14] drm/panic: Compile KUnit tests as module Thomas Zimmermann
2026-09-09 9:37 ` sashiko-bot
2026-09-09 12:45 ` ✗ i915.CI.BAT: failure for drm/panic: Split into core and helpers (rev4) 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=20260909091326.EB2501F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=eperezma@redhat.com \
--cc=gary@garyguo.net \
--cc=imx@lists.linux.dev \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=mst@redhat.com \
--cc=ojeda@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tzimmermann@suse.de \
--cc=virtualization@lists.linux.dev \
--cc=wsa+renesas@sang-engineering.com \
/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