| Message ID | 20260103200510.3605009-5-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=1767470751; bh=BsuxLtsghR4vtuUvfXLZiAcVbsSUy9WBVDX/uCiDYiw=; 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=cI53pqpFlziW6E7tpvU/c9ro/L4SQK8xXzACHUH6MmoQ8X77rpcNT/GyN7D5ivhWy 8dlc4IIVeEFuSUUGQa1sgxkCizQxUYqEYUURavdRbiUEumjeUuboxSDwQwsZIG+8aT FsmJ6XUsDzVx72LPiMKpE5j11PiDYl7Ooj0rpPJeByesqMxCrHcNG4ctS32mVyhCm7 OUnbnQ7au96xCoyxNUWwUaBgOnldNzH4tBr8HVi3Di7P4YUA9n2D+j+BslQTiGXy2L y4z9uI1iBh+FjcewX9LR6tqWNfZhaknMYFMQpqSeQLTLEGKqRextA5KHll3k07o37K 7GiUpjkM8M+Pg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9579569090 for <u-boot-concept@u-boot.org>; Sat, 3 Jan 2026 13:05:51 -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 XjUAJ31-inbK for <u-boot-concept@u-boot.org>; Sat, 3 Jan 2026 13:05:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470751; bh=BsuxLtsghR4vtuUvfXLZiAcVbsSUy9WBVDX/uCiDYiw=; 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=cI53pqpFlziW6E7tpvU/c9ro/L4SQK8xXzACHUH6MmoQ8X77rpcNT/GyN7D5ivhWy 8dlc4IIVeEFuSUUGQa1sgxkCizQxUYqEYUURavdRbiUEumjeUuboxSDwQwsZIG+8aT FsmJ6XUsDzVx72LPiMKpE5j11PiDYl7Ooj0rpPJeByesqMxCrHcNG4ctS32mVyhCm7 OUnbnQ7au96xCoyxNUWwUaBgOnldNzH4tBr8HVi3Di7P4YUA9n2D+j+BslQTiGXy2L y4z9uI1iBh+FjcewX9LR6tqWNfZhaknMYFMQpqSeQLTLEGKqRextA5KHll3k07o37K 7GiUpjkM8M+Pg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 82F9069060 for <u-boot-concept@u-boot.org>; Sat, 3 Jan 2026 13:05:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470748; bh=+eqgUBDh8FRaO2nl4R6hWxByuyyczQ6bGXF9W2d+Evc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lvq9aRNyW+93DWW4Xb9RPxKk3ziaBEr63bBruAYSXzMNm3CthvNW97qOKnf3VJhLU wvjvhXzTtUEKXM0qSPr+Pnc3vzVDdw3sIi1XvBah/XSzMiFBLfvj2fk0PuEvjz/Xkb XJFscH3hXvgQ/5hp+FvfnIDRfohpKAFIhE6utgYIGEbLGpNuumXDCMqZ46osaOKzh3 Xsj6+xaU1X3TdkZdxy8gYQKKAUT2l/rrTKWf5bB0IdbBxcWgU7h4ZJko4sgZeT5oDE H3hv4ZQnlrGgdcwyx0c3e0Qq4KqbC/kYgbhrfBoNTWfxxzCz/I2n151hXtGClGcC0F zChma8XqsCAMA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E843169060; Sat, 3 Jan 2026 13:05:48 -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 9CEBG3Plj3nK; Sat, 3 Jan 2026 13:05:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470744; bh=LaXuLqp5skaMVLEGiBDouJf91V1ENgifpioIspaZ1c4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DTp1NsWuEydgDAPKTFTUIcb2gy2RY3wo7X+VU4Y/5KJC3loK1EKsXI3AbP4hpKWBJ 8j+UnzTAzwbrJOND6ULivgPIWD5n2OtofzRJ/ulWCy9XCvUjw5nGhnb+RdPrSXw69r W60qnSYe3JSpShgo9SYLMHVuLfomcOGncxZ+R6H2KjPZRBk1e+DROytzukmbOuUmpy wq6f/xMH5uWc7M9GHLNq+8ZaKFpoG0izu6pjPjD7C5b/Ebm4UBe2AnD3sFs3d9ErZH ncv1DOBulLbkMSAxuxZOKdVJxlUloOyc5gFrSwLoquFYLWikkO92bOxdGIe2/AqJ3Q 8pMax8o886jbA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8D63768FCC; Sat, 3 Jan 2026 13:05:44 -0700 (MST) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Sat, 3 Jan 2026 13:04:35 -0700 Message-ID: <20260103200510.3605009-5-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: SSRFJMIZO7SWC2EN4OEFQYFW7QA6R4FL X-Message-ID-Hash: SSRFJMIZO7SWC2EN4OEFQYFW7QA6R4FL 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 04/29] video: Fix memory leak of vidconsole device name 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/SSRFJMIZO7SWC2EN4OEFQYFW7QA6R4FL/> 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 vidconsole device name is allocated with strdup() but never marked as allocated, so it is not freed when the device is removed. This causes a memory leak on every video device probe/remove cycle. Mark the name as allocated so driver model frees it on device removal, and free it on the error path. Fixes: 83510766c90a ("dm: video: Add a uclass for the text console") Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- (no changes since v1) drivers/video/video-uclass.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 3e02c48d399..2789c352113 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -795,8 +795,10 @@ static int video_post_probe(struct udevice *dev) ret = device_bind_driver(dev, drv_name, str, &cons); if (ret) { debug("%s: Cannot bind console driver\n", __func__); + free(str); return ret; } + device_set_name_alloced(cons); ret = device_probe(cons); if (ret) {