| Message ID | 20260416023021.626949-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=1776306654; bh=pa6bwdApYHkpYr3hqCWeSGSRsFkq1ZqTXRkmdmiUGnk=; 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=KCd5QtohBx3Kxu6xC3SZuBtV9H97gCvzaEIRi92LgeO9jZR4rV2HfV0vGC71Y7A1c KkA8yvMby0CbHGeG31oPcxQ+7WZcITFpc5ObT28bfUfD741udwDBxoT3K0n1yh7kSd yj8S5l43eLc2kVpD+q1+YOLJFZRUCYriB1Ast7NY= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 47AB46A4BB for <u-boot-concept@u-boot.org>; Wed, 15 Apr 2026 20:30:54 -0600 (MDT) 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 lS_kWuZDfvWp for <u-boot-concept@u-boot.org>; Wed, 15 Apr 2026 20:30:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776306653; bh=pa6bwdApYHkpYr3hqCWeSGSRsFkq1ZqTXRkmdmiUGnk=; 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=g2jVaNqgtulptRLyz1M9TvhadSAmA0m0VfZzbeSheySIPAmwiGiCTE+G/BqJAbYnK LB5G+zPSldKaANj0R6bymt3nsE9iIdAflEIwAGPxyDbaHtM0etRM+BlS+94M6FGysw 6ZLhiOrddwocwY4dEwZhcrmJYllbvYWRZUAaMqJI= Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 948006A4B0 for <u-boot-concept@u-boot.org>; Wed, 15 Apr 2026 20:30:53 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776306650; bh=BWDLN20u9OxI8JqOkMQPglrtcdqwudKogcPKZ3cnQl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LYDGMzbWhPXW5cCSkCpzrSvoUu01ieyyLZ8Twy3nBZMmFVJJtkYf+rrZPIKkHhuVM KgeAVTY+Jj9EvlrVaU6+JgbWMBGt8ZftqEcQ0fERmpsQvIhqyT2WIzoy6uhORFl6hs B7YbKBswvAOR4Y/OOMYaxgG3l0J3vr/j6mzKB7KM= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B74116A4A0; Wed, 15 Apr 2026 20:30:50 -0600 (MDT) 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 V3FDqBF_xRi3; Wed, 15 Apr 2026 20:30:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776306649; bh=N9vQcMIdFWpmuBQ58InC81evXkm/UzeS1czncUZdDZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SF+hW7HELj4BDZ+yJnr7TFY+8TSG01+sSsrqVnMyb+E9fkrTZ3l/jPtqQIVS2mhfa N7FxyaNwJueYGj2GEzAuQscGp0UOalmQAeonE7pZNFkXkJEeQl0pqA6dj9om+GRiHT b34S1CrHKubLf2DOWiIb7YRku4JpDaJext3uFhow= Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E6E4B6A4A5; Wed, 15 Apr 2026 20:30:48 -0600 (MDT) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Wed, 15 Apr 2026 20:29:31 -0600 Message-ID: <20260416023021.626949-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260416023021.626949-1-sjg@u-boot.org> References: <20260416023021.626949-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AEP5HXV5SBCJS2YOKXULGP4GKVBKOYUJ X-Message-ID-Hash: AEP5HXV5SBCJS2YOKXULGP4GKVBKOYUJ 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: Simon Glass <sjg@chromium.org> X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/33] virtio: Free mmio base when removing sandbox virtio emul 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/AEP5HXV5SBCJS2YOKXULGP4GKVBKOYUJ/> 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 |
Fix memory leaks and test pollution in sandbox tests
|
|
Commit Message
Simon Glass
April 16, 2026, 2:29 a.m. UTC
From: Simon Glass <sjg@chromium.org> sandbox_emul_of_to_plat() used memalign() for its emulated MMIO region, but sandbox_emul_remove() only unregisters the MMIO callback; the buffer itself (several KB per device) is not freed. Free it on removal. Signed-off-by: Simon Glass <sjg@chromium.org> --- drivers/virtio/sandbox_emul.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/virtio/sandbox_emul.c b/drivers/virtio/sandbox_emul.c index 2c75fd546d1..cde666ce99d 100644 --- a/drivers/virtio/sandbox_emul.c +++ b/drivers/virtio/sandbox_emul.c @@ -283,7 +283,10 @@ static int sandbox_emul_of_to_plat(struct udevice *dev) static int sandbox_emul_remove(struct udevice *dev) { + struct sandbox_emul_priv *priv = dev_get_priv(dev); + sandbox_mmio_remove(dev); + free(priv->mmio.base); return 0; }