From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B48F3D3497; Thu, 15 Jan 2026 17:27:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498053; cv=none; b=mMsGAExIBiDN3J7tErsMCQJfQd2jtK+pBeo27t2IoHYWY4KjsELh7o2cnhcrZe5Eki9Ib4nV1yx+0YKFkrG+qq92iAWaV03PFJBRO8GpniI0pvNq0KCA0bgaDCKn/iJQUIB5/8QPFy9yDvBI8K7eBijsiBeXTqghzT9Srab1fPg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498053; c=relaxed/simple; bh=I4wTh8k3MQlY2SFLMWI2/00h6vo+Ww7b1BtuAf1A78U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O37SNWTOW97RYMWJrTLL67acM4Gx/j58B0K6FZFUFqbcCiw2nzXnEL6JGOjC1zwxIG/9fdYqNOaB02TssQRTaDsp8S2bd3XSJg0cbjDltsLwOXW7bV5gIHL7hoKJwcI/vc2rTIBWtGpJ+VeoQ/6NwIbQD/LmlrfjcB62DYcuqlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Nwe/xCfv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Nwe/xCfv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 899D0C19423; Thu, 15 Jan 2026 17:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768498052; bh=I4wTh8k3MQlY2SFLMWI2/00h6vo+Ww7b1BtuAf1A78U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nwe/xCfv/JgisRXF34LewD/mZzHXNAS8oxImekkCrm14K4ddjJ55c8vhAXoKR6IPj vn2iMjwYouL87IqeqwThoKfpNQBdbtFyYfrhhwBHnrl2hj1E8cAC7Cpnjt8ttxmkQS kswI2E0MYo+S2N9qOZki0dwrHLLRo7eWaCdzffyo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Miaoqian Lin , Thinh Nguyen Subject: [PATCH 5.15 296/554] usb: dwc3: of-simple: fix clock resource leak in dwc3_of_simple_probe Date: Thu, 15 Jan 2026 17:46:02 +0100 Message-ID: <20260115164256.947677700@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115164246.225995385@linuxfoundation.org> References: <20260115164246.225995385@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miaoqian Lin commit 3b4961313d31e200c9e974bb1536cdea217f78b5 upstream. When clk_bulk_prepare_enable() fails, the error path jumps to err_resetc_assert, skipping clk_bulk_put_all() and leaking the clock references acquired by clk_bulk_get_all(). Add err_clk_put_all label to properly release clock resources in all error paths. Found via static analysis and code review. Fixes: c0c61471ef86 ("usb: dwc3: of-simple: Convert to bulk clk API") Cc: stable Signed-off-by: Miaoqian Lin Acked-by: Thinh Nguyen Link: https://patch.msgid.link/20251211064937.2360510-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-of-simple.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -71,11 +71,11 @@ static int dwc3_of_simple_probe(struct p simple->num_clocks = ret; ret = clk_bulk_prepare_enable(simple->num_clocks, simple->clks); if (ret) - goto err_resetc_assert; + goto err_clk_put_all; ret = of_platform_populate(np, NULL, NULL, dev); if (ret) - goto err_clk_put; + goto err_clk_disable; pm_runtime_set_active(dev); pm_runtime_enable(dev); @@ -83,8 +83,9 @@ static int dwc3_of_simple_probe(struct p return 0; -err_clk_put: +err_clk_disable: clk_bulk_disable_unprepare(simple->num_clocks, simple->clks); +err_clk_put_all: clk_bulk_put_all(simple->num_clocks, simple->clks); err_resetc_assert: