| Message ID | 20260103200510.3605009-6-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=1767470753; bh=YxmRAX3x2pdbckx1gT267R8WHNjhvBDIJCyld2dj8PI=; 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=YtHj5igW2edCgjZWEwOTuxs3B7+tvi/fLv5oTHlmxzkM6yZG1F9bD23YBdPTitv+w rFZ0SGG6cH6CKiiXe34UnI0d9vxTEXaVIN9YtxoWRtf7nnPfO0rHKBZArqUJAOwRE6 2tZDvO4NNrBPWqbjQ6zPqHjD/Czqh4H865TlyDFQX7v3tzR9sznDF3X4z19mJdJ4gt OQcHaHmy+oquFm+GDUKuRKvymQhwrEfWggp5dz85E4AU2+4d/etZ4wFK3ZiKMviHIr mdn/HmSA75iAbRii/Ks1hxZqlkDDrE7qIrSsANzMvC/yUVjKwXMxWfwdAHhnM2D0hu ZUHgdmCTL0ReQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2719369060 for <u-boot-concept@u-boot.org>; Sat, 3 Jan 2026 13:05:53 -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 MFgTGJ6lPofp for <u-boot-concept@u-boot.org>; Sat, 3 Jan 2026 13:05:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470752; bh=YxmRAX3x2pdbckx1gT267R8WHNjhvBDIJCyld2dj8PI=; 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=FyIA//jAyKzqvkXDOrFIh76tEmo5JAkTzpMediu1DoEnwP+CawQGpCSZVh/KaBzeW QV/NJPowpbjr99qqGGf0IenUHlF/KXog7XjZr5HAaOZEcZvzRubEbyO65fHlMMSJ5K QhNEyffy7kxZFO2H47Dg089tZYWdDI7omw8h4lRR44J7rQhG6bVv/xEEu2Om4jCZs/ 7R5PNbX1XpvIaHEiPWmv1o+TiJMKz5OhbK4/DMMmTfDBN/xTSZ0xQr5x2H6wXIoW/k oZFbzhP6OFy4oExxY43q4CnyvU7Ezx9my0xem/IevSRvwUDywPyWc+2lopKxQhFEFm 7324xP+mBA8TA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1C92A69096 for <u-boot-concept@u-boot.org>; Sat, 3 Jan 2026 13:05:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470749; bh=OuX7s3A7M5cosrRURHBHFjx+wR9kgGcpF6jpdZcccbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tS3inybeYFXQsIlW2pef8Ad6hlSrVLdP4CCvLmNXp2OpY4l7mOIMloKc0YbwZVYkV aLugTMFgzQ1Hx0QjkiQhSHxt7RAQaIvyzzoHiyeKz94LdUN5SnZzGEOdg6QkAfbbmG W117cie3jbhan4+GBSzLGZatN2WkOTkhy5eFV8c085p+USgPUEkj3VO2rbx7j8ijdk Z7Fnv8+p+KszgdS3mj1hV0VMoCtEvmDLh/dAaChciBP+efhKBIRYf1iW2aJpQkDEvh TQuZ+TyfCeyEjEwjftIPGcP8vLEZ92KCR/tXfsUrtUl8Z1GBHHM/eMTyAQm/uEYnPB TCkA64IdXLIvw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BD9F86907B; Sat, 3 Jan 2026 13:05:49 -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 J1ESPTp5lGDG; Sat, 3 Jan 2026 13:05:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470749; bh=PDUw7nCohlQtatNGO9itRGlMg0px/UsWgDg4VuoYca4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ezd3aWbsxy+AV9JGl0q9xF65O6lctY9aisCLlou/Q/KSN84hMEMejFmzzKq2pc1RD d6u5OAlAyz6YRFJJB74SLBgIBeSN5cTbnofkf9MJ9MUrTd6sFz3ryCnQY5rrz0YqDl eEnBq3u7EIoyjsns/AB4BtR4JD2+338c8trywGSrYBesptudfLkOQ1wr95WiHgtPvu L6otjcR4fjgq3ILQ3t2Vhnm/Ju+S8mKChZAoC243aJoUzJCuyZb7crCit/rcX03Wg8 hJ1Fk485tpfMw42jZZUb2XF2nvo7i4jDma/iywbSqn640v/U+Y01Uz2m2QD5B2goEj A6SUH90bvRuew== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 36C8768FCC; Sat, 3 Jan 2026 13:05:49 -0700 (MST) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Sat, 3 Jan 2026 13:04:36 -0700 Message-ID: <20260103200510.3605009-6-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: KQBCY2UITMI5HPEG7DGV6IN3FEHUX2AY X-Message-ID-Hash: KQBCY2UITMI5HPEG7DGV6IN3FEHUX2AY 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 05/29] video: vidconsole: Free cursor save buffer 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/KQBCY2UITMI5HPEG7DGV6IN3FEHUX2AY/> 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 cursor save_data buffer is allocated when the cursor is enabled but never freed. Add a pre_remove callback to free this buffer when the vidconsole device is removed. Fixes: aebedeac4478 ("video: Provide a buffer to hold pixels behind the cursor") Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- (no changes since v1) drivers/video/vidconsole-uclass.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 52a51b5e1c1..8efe458287a 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -14,6 +14,7 @@ #include <command.h> #include <console.h> #include <log.h> +#include <malloc.h> #include <dm.h> #include <video.h> #include <video_console.h> @@ -865,11 +866,21 @@ static int vidconsole_post_probe(struct udevice *dev) return stdio_register(sdev); } +static int vidconsole_pre_remove(struct udevice *dev) +{ + struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); + + free(vc_priv->curs.save_data); + + return 0; +} + UCLASS_DRIVER(vidconsole) = { .id = UCLASS_VIDEO_CONSOLE, .name = "vidconsole0", .pre_probe = vidconsole_pre_probe, .post_probe = vidconsole_post_probe, + .pre_remove = vidconsole_pre_remove, .per_device_auto = sizeof(struct vidconsole_priv), };