[{"id":3678030,"web_url":"http://patchwork.ozlabs.org/comment/3678030/","msgid":"<6f873006-9b2e-406d-a561-da951a5d0d5d@mailbox.org>","list_archive_url":null,"date":"2026-04-16T09:06:03","subject":"Re: [PATCH v2] usb: dwc3: core: fix memory leaks in event buffer\n cleanup","submitter":{"id":85664,"url":"http://patchwork.ozlabs.org/api/people/85664/","name":"Marek Vasut","email":"marek.vasut@mailbox.org"},"content":"On 4/16/26 7:55 AM, Gurumoorthy Santhakumar wrote:\n> In dwc3_free_one_event_buffer(), only the DMA buffer (evt->buf) was\n> being freed via dma_free_coherent(), but the evt structure itself was\n> never explicitly freed, causing a memory leak.\n> \n> In dwc3_free_event_buffers(), the ev_buffs pointer array allocated\n> with memalign() was never freed after iterating and releasing all\n> individual event buffers, causing another memory leak.\n> \n> Fix both leaks by freeing the evt struct in\n> dwc3_free_one_event_buffer() and freeing dwc->ev_buffs in\n> dwc3_free_event_buffers() after all entries have been released.\n> \n> Signed-off-by: Gurumoorthy Santhakumar <gurumoorthy.santhakumar@oss.qualcomm.com>\n\nReviewed-by: Marek Vasut <marek.vasut+usb@mailbox.org>\n\nThank you","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256\n header.s=mail20150812 header.b=G8RoupDh;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=mailbox.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n secure) header.d=mailbox.org header.i=@mailbox.org header.b=\"G8RoupDh\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=mailbox.org","phobos.denx.de;\n spf=pass smtp.mailfrom=marek.vasut@mailbox.org"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxBvW2qr1z1yG9\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 19:06:15 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id F30C58407E;\n\tThu, 16 Apr 2026 11:06:11 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id A5342841D5; Thu, 16 Apr 2026 11:06:10 +0200 (CEST)","from mout-p-102.mailbox.org (mout-p-102.mailbox.org\n [IPv6:2001:67c:2050:0:465::102])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id B423483FC0\n for <u-boot@lists.denx.de>; Thu, 16 Apr 2026 11:06:08 +0200 (CEST)","from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4fxBvM0bMCz9tk9;\n Thu, 16 Apr 2026 11:06:07 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org;\n s=mail20150812; t=1776330367;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=CFz6mP6rjrGYlhQTvsAZLY2CFLYZNMdMwya+2SgeqnM=;\n b=G8RoupDh8AxTDA4cRLpx0WkDB+aywSCYEdVzxBExD7u5pYYl6/iGchDQcOldK7w1sbIETd\n xrsbFkDmDz8ouHnv0LlzD8EA1RBg3ODW8FLiW+rkm8iEqbsSnRB06No7VHkEMDkOeUkLxs\n 8L+Umdi+0InIfcAfLCaWReBgTN2VoyHZFb5krb65VAgwmUspTkUiSuVMRJ/TtFzJ2ea7Oz\n j57qP8JvrV01SHT1iuVC2R3OEPVLSHIa9KcuG0Sc2kAtf81opCaHbnKlXWmKR9AI0hGX2T\n 7T68AHRlQ+6igRJCTgf46VYwsr0Jkh+5mgZDH84s5001p9IGnDKFH+ujVeF90g==","Message-ID":"<6f873006-9b2e-406d-a561-da951a5d0d5d@mailbox.org>","Date":"Thu, 16 Apr 2026 11:06:03 +0200","MIME-Version":"1.0","Subject":"Re: [PATCH v2] usb: dwc3: core: fix memory leaks in event buffer\n cleanup","To":"Gurumoorthy Santhakumar <gurumoorthy.santhakumar@oss.qualcomm.com>,\n trini@konsulko.com, mkorpershoek@kernel.org, macromorgan@hotmail.com,\n casey.connolly@linaro.org, quic_varada@quicinc.com,\n felipe.balbi@linux.intel.com, u-boot@lists.denx.de","References":"<20260416055501.494002-1-gurumoorthy.santhakumar@oss.qualcomm.com>","Content-Language":"en-US","From":"Marek Vasut <marek.vasut@mailbox.org>","In-Reply-To":"\n <20260416055501.494002-1-gurumoorthy.santhakumar@oss.qualcomm.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","X-MBO-RS-META":"4gfnmgmqx4itnronph3f9w73fx9ajmdi","X-MBO-RS-ID":"e47a85424249cf28fe6","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3678555,"web_url":"http://patchwork.ozlabs.org/comment/3678555/","msgid":"<87h5pagg1e.fsf@kernel.org>","list_archive_url":null,"date":"2026-04-17T08:14:05","subject":"Re: [PATCH v2] usb: dwc3: core: fix memory leaks in event buffer\n cleanup","submitter":{"id":90582,"url":"http://patchwork.ozlabs.org/api/people/90582/","name":"Mattijs Korpershoek","email":"mkorpershoek@kernel.org"},"content":"Hi Gurumoorthy,\n\nThank you for the patch.\n\nOn Thu, Apr 16, 2026 at 11:25, Gurumoorthy Santhakumar <gurumoorthy.santhakumar@oss.qualcomm.com> wrote:\n\n> In dwc3_free_one_event_buffer(), only the DMA buffer (evt->buf) was\n> being freed via dma_free_coherent(), but the evt structure itself was\n> never explicitly freed, causing a memory leak.\n>\n> In dwc3_free_event_buffers(), the ev_buffs pointer array allocated\n> with memalign() was never freed after iterating and releasing all\n> individual event buffers, causing another memory leak.\n>\n> Fix both leaks by freeing the evt struct in\n> dwc3_free_one_event_buffer() and freeing dwc->ev_buffs in\n> dwc3_free_event_buffers() after all entries have been released.\n>\n> Signed-off-by: Gurumoorthy Santhakumar <gurumoorthy.santhakumar@oss.qualcomm.com>\n\nReviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=PWjkMLBf;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.b=\"PWjkMLBf\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=quarantine dis=none)\n header.from=kernel.org","phobos.denx.de;\n spf=pass smtp.mailfrom=mkorpershoek@kernel.org"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxnj30zPhz1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 18:14:15 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 15FFC83FC0;\n\tFri, 17 Apr 2026 10:14:13 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 4A46F84214; Fri, 17 Apr 2026 10:14:12 +0200 (CEST)","from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 3F1B883B99\n for <u-boot@lists.denx.de>; Fri, 17 Apr 2026 10:14:10 +0200 (CEST)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by tor.source.kernel.org (Postfix) with ESMTP id 1A9B160128;\n Fri, 17 Apr 2026 08:14:09 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 250DDC19425;\n Fri, 17 Apr 2026 08:14:07 +0000 (UTC)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,\n RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1776413648;\n bh=2BeoxLSR6tamyAiYLM/Y/Rtm/gjd5xeGRGDr3vAva0w=;\n h=From:To:Subject:In-Reply-To:References:Date:From;\n b=PWjkMLBfdocrRkFO6e4RsDMCi0G6B0bk6OLuzhj/SAuQdqXs9Zgi8XNNFtiLymnR8\n ZHRSuy1ntPq3BYQzJxN7CTwEQMFAAPm1T2lSS4/o0pyTe8R6p6lHuRNNb9yIUQldSc\n wGVo181OwNDOFHvWEMVUwO3bOcPOEc4fda09OjS9iyG+nXVfdTD3WcpZaXxcz9jo3A\n g31HeZk8L36iTecdpfRf/Hf8S8c/IYJPqAKQV259vgk3QK70AmlZ8ePs7T1zZ7EweX\n aiGguhD+MTFPsu31eMc2tKkvJ7N9oYnEQGAG16y1VA8nUS43jWeQQiTm5d0xiaVtZg\n DdWFmp5Ofx1yA==","From":"Mattijs Korpershoek <mkorpershoek@kernel.org>","To":"Gurumoorthy Santhakumar <gurumoorthy.santhakumar@oss.qualcomm.com>,\n marex@denx.de, trini@konsulko.com, mkorpershoek@kernel.org,\n macromorgan@hotmail.com, casey.connolly@linaro.org,\n quic_varada@quicinc.com, felipe.balbi@linux.intel.com,\n gurumoorthy.santhakumar@oss.qualcomm.com, u-boot@lists.denx.de","Subject":"Re: [PATCH v2] usb: dwc3: core: fix memory leaks in event buffer\n cleanup","In-Reply-To":"\n <20260416055501.494002-1-gurumoorthy.santhakumar@oss.qualcomm.com>","References":"<20260416055501.494002-1-gurumoorthy.santhakumar@oss.qualcomm.com>","Date":"Fri, 17 Apr 2026 10:14:05 +0200","Message-ID":"<87h5pagg1e.fsf@kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}}]