From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: fbdev: fbcon: fix memory leak in error path of fbcon_do_set_font()
Date: Tue, 26 May 2026 07:32:10 +1000 [thread overview]
Message-ID: <review-overall-20260525082741.600003-1-w15303746062@163.com> (raw)
In-Reply-To: <20260525082741.600003-1-w15303746062@163.com>
Overall Series Review
Subject: fbdev: fbcon: fix memory leak in error path of fbcon_do_set_font()
Author: w15303746062@163.com
Patches: 1
Reviewed: 2026-05-26T07:32:10.831353
---
This is a single patch (not a series) that fixes a real memory leak bug in `fbcon_do_set_font()`. The bug analysis is correct: in the error path (`err_out`), the `p->userfont = old_userfont` restoration was inside the `if (userfont)` block, meaning when setting a builtin font failed (i.e., `userfont == 0`), the userfont flag was never restored. This could leave `p->userfont == 0` while `p->fontdata` still pointed to a previously-allocated user font, causing `fbcon_free_font()` to skip freeing it on console teardown.
**However, this patch does not apply to current mainline (drm-next).** As the author acknowledges, mainline has been refactored to use `font_data_t` with proper reference counting (`font_data_get()`/`font_data_put()`), which completely eliminated the `userfont` flag and the associated bug class. I confirmed that the current tree has zero references to `userfont` in `fbcon.c`, and the error path now simply calls `font_data_put(data)` to release the new font data.
**This patch is only applicable to stable/older kernels (7.0 and earlier)** that still use the legacy `userfont` logic. It should be submitted to the stable mailing list (stable@vger.kernel.org) with the appropriate stable tree version targeting, not to dri-devel as a mainline patch.
**Verdict: The fix is logically correct for the old code, but it is NAK for mainline since the code it modifies no longer exists. It needs to be resubmitted targeting the appropriate stable branches.**
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 21:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 8:27 [PATCH 7.0] fbdev: fbcon: fix memory leak in error path of fbcon_do_set_font() w15303746062
2026-05-25 21:32 ` Claude Code Review Bot [this message]
2026-05-25 21:32 ` Claude review: " Claude Code Review Bot
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=review-overall-20260525082741.600003-1-w15303746062@163.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.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