| Message ID | 20260103200510.3605009-7-sjg@u-boot.org |
|---|---|
| State | New |
| Headers |
Return-Path: <concept-bounces+u-boot-concept=u-boot.org@u-boot.org> X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470756; bh=tsrRvl3yKzgEwKLEhZsJkhrczyOQqD9UqYfHYadk7SU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=JupaJdH1z077Khz9B2t5FAfXT5pF/hWQHtZvGHcXeEvaxz13Hkzp7l6hZM4nDVN1O RN7FbPOsiRuNpNPzM4zb0nkTRv1O8u7CPEpvm91+6Og2WjrXCax50lRtT2VhTZv6Ni XHNzXThBdIgVovXh1xcqeIv2Q0w4AyskIXojM2UlKF0Sp013y6lj1tF8KILQq3TOdk EUnLxv7U1WJs/qgnYT/2cZTthNZTbyXg1u34zvHiEf5yVDNiTsz3dmYbRxGLtBlLru OBRsHs6hUGhfkrhDsll/SA0sCABtWnhO70bMOp/nMrgSXt3Vp0la5IP35pridN916Z uDd8xhZKFmYZQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DA7B569095 for <u-boot-concept@u-boot.org>; Sat, 3 Jan 2026 13:05:56 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id FdArCEr2HT7t for <u-boot-concept@u-boot.org>; Sat, 3 Jan 2026 13:05:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470756; bh=tsrRvl3yKzgEwKLEhZsJkhrczyOQqD9UqYfHYadk7SU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=JupaJdH1z077Khz9B2t5FAfXT5pF/hWQHtZvGHcXeEvaxz13Hkzp7l6hZM4nDVN1O RN7FbPOsiRuNpNPzM4zb0nkTRv1O8u7CPEpvm91+6Og2WjrXCax50lRtT2VhTZv6Ni XHNzXThBdIgVovXh1xcqeIv2Q0w4AyskIXojM2UlKF0Sp013y6lj1tF8KILQq3TOdk EUnLxv7U1WJs/qgnYT/2cZTthNZTbyXg1u34zvHiEf5yVDNiTsz3dmYbRxGLtBlLru OBRsHs6hUGhfkrhDsll/SA0sCABtWnhO70bMOp/nMrgSXt3Vp0la5IP35pridN916Z uDd8xhZKFmYZQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C41B668FCC for <u-boot-concept@u-boot.org>; Sat, 3 Jan 2026 13:05:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470755; bh=kYRIaAcBZQZy8I/t9hLOIVXJPc2Bk4CxXMX4VDvhDbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gqDBRkSlZoaGyYlguqui1gmLSOmGxvpOJkG+awoIGySAAghH2GQqJ/Pw9Bx9XR0rq fi41f0yiAoP5A3ngeyF7X7ZQ/6oXeBHk8aT5xsgtjvXx1QnVh3HDy+RQ3n+enY0dND Ziizyk1WLqrZBLX+CWPhmfS1z190kVeO07z0nOdogvCg6hDVeKMXHKDdihT9PYHCK+ J1V5GYsq7dXe7MRzM+b2Iwn/q2XPY2CPzxbcEbBYDEecSLc1y6OKn0UHTA+JF5+IKn TTdqPfwqfcEJKmOcqF7pPHSpWVHRSOBii/2RtO0V2kMAbPxswQullik+7VcvtY3s0C +VqYV2qJ0itxA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 75CF36907B; Sat, 3 Jan 2026 13:05:55 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id A_mCIwPvbjZf; Sat, 3 Jan 2026 13:05:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470750; bh=QEV7gmdZeRtEyY2MlXz2HRWQI+OAfyYKuOqq7q6TV1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AkaDMwO7Iw5CdYcpw4hs9XanAUIsq8qtSGFNtD8+HDQb79rZMrwvQJ6/06iXS5lWs OJEm3MiECgnqT9x1nk91r64eaDct8dwweRhsHiBpK9sWTS7zTom2Pnyid/xypfO2Ql pgxkN4yp9RmG22Xp70oTxAK0BLfr0OnD4Z9ebHG8xU0CZeVVLuJoAQc91hK3CbQ/1B Bi7dpnDsGStJvDcR72PPxgR+B8HaJL1gpSd0Woh0W7NCPDvi12EmuusS2xjx2FqDAE uRHo66nXvy7waV23RIt1gMg+iET7DpgNzazsrkKjYgMUMwCBBcDSt676DKB9fjwFI9 6uKjLYZXA34xQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0E46E68FCC; Sat, 3 Jan 2026 13:05:50 -0700 (MST) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Sat, 3 Jan 2026 13:04:37 -0700 Message-ID: <20260103200510.3605009-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103200510.3605009-1-sjg@u-boot.org> References: <20260103200510.3605009-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5R5VULP6MTGEJIJ36K7E72CZZBQQZMTR X-Message-ID-Hash: 5R5VULP6MTGEJIJ36K7E72CZZBQQZMTR X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt <xypron.glpk@gmx.de>, Simon Glass <simon.glass@canonical.com>, Claude <noreply@anthropic.com> X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 06/29] video: truetype: Free allocated buffers on device removal List-Id: Discussion and patches related to U-Boot Concept <concept.u-boot.org> Archived-At: <https://lists.u-boot.org/archives/list/concept@u-boot.org/message/5R5VULP6MTGEJIJ36K7E72CZZBQQZMTR/> List-Archive: <https://lists.u-boot.org/archives/list/concept@u-boot.org/> List-Help: <mailto:concept-request@u-boot.org?subject=help> List-Owner: <mailto:concept-owner@u-boot.org> List-Post: <mailto:concept@u-boot.org> List-Subscribe: <mailto:concept-join@u-boot.org> List-Unsubscribe: <mailto:concept-leave@u-boot.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit |
| Series |
Malloc debugging and test/py improvements
|
|
Commit Message
Simon Glass
Jan. 3, 2026, 8:04 p.m. UTC
From: Simon Glass <simon.glass@canonical.com> The scratch buffer and glyph buffer are allocated during probe but never freed. Add a remove callback to free these buffers when the truetype console device is removed. Fixes: 159af15074f2 ("video: truetype: Add a scratch buffer to use malloc() less") Fixes: 69d2f4ab58d2 ("video: truetype: Use pre-allocated buffer for glyph rendering") Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- (no changes since v1) drivers/video/console_truetype.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 6e65f55d598..c33686aff9b 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -1243,6 +1243,16 @@ static int console_truetype_probe(struct udevice *dev) return 0; } +static int console_truetype_remove(struct udevice *dev) +{ + struct console_tt_priv *priv = dev_get_priv(dev); + + free(priv->scratch_buf); + free(priv->glyph_buf); + + return 0; +} + struct vidconsole_ops console_truetype_ops = { .putc_xy = console_truetype_putc_xy, .move_rows = console_truetype_move_rows, @@ -1265,5 +1275,6 @@ U_BOOT_DRIVER(vidconsole_truetype) = { .id = UCLASS_VIDEO_CONSOLE, .ops = &console_truetype_ops, .probe = console_truetype_probe, + .remove = console_truetype_remove, .priv_auto = sizeof(struct console_tt_priv), };