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 6AE221C68C; Sun, 1 Sep 2024 16:36:48 +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=1725208608; cv=none; b=XHClcfnR0DNw/E11zmgz7Hr6Y+27VDgrTlcSGnC4T/TvvjYovlh4Nj8MgbvCaNN44uCl4x7aMdrcJpbSgpNOdUl3/5CcHb6BT3+EsR1OuDCtERaFC/JPMYIJJs6PxhuWIWG5JWZvWzyiGwdTHVoROlMY3NRAeHtmOhTZXxigqaQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725208608; c=relaxed/simple; bh=aeRic6L0AOwDhcKMar2NwaaVQ9RT/9o70eQLpB4OMo8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ymeey2pHg5tK3O+aqCV4kaOWSn1GhOikHc+8Jl+HtEOhU9wBYv8Ty45Ud3wJaMxKpmq2nyC9N5QnWgLwJVgFmPjOFGvNYRrj1TLwxq5moX7U6PM52z7CMO80QQY6b6Lcj0npUALODSSQpGsKQTYjOuw2eQQA+MaMgiGWMWFFjXk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cgLlYgKi; 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="cgLlYgKi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCFC5C4CEC3; Sun, 1 Sep 2024 16:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725208608; bh=aeRic6L0AOwDhcKMar2NwaaVQ9RT/9o70eQLpB4OMo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cgLlYgKi8AicnR7umgo9uwZcGOfnYZFM2LSdUp7gypMoEClcpGhZ2nXz4QShA6Xz9 36BVKxmkoYbQUqbDgWkyBw8q4FJDgAamTx5I7h6/0g6KyciY0KokqSzBy5vSVzxS4L VHvZbI83XUnDyFMwT1qseL/FHmsl+EmgrjGz8xEc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Krzysztof Kozlowski , Patrice Chotard , Thinh Nguyen Subject: [PATCH 6.10 135/149] usb: dwc3: st: add missing depopulate in probe error path Date: Sun, 1 Sep 2024 18:17:26 +0200 Message-ID: <20240901160822.526717335@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240901160817.461957599@linuxfoundation.org> References: <20240901160817.461957599@linuxfoundation.org> User-Agent: quilt/0.67 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 6.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Krzysztof Kozlowski commit cd4897bfd14f6a5388b21ba45a066541a0425199 upstream. Depopulate device in probe error paths to fix leak of children resources. Fixes: f83fca0707c6 ("usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC") Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski Reviewed-by: Patrice Chotard Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20240814093957.37940-2-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-st.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/usb/dwc3/dwc3-st.c +++ b/drivers/usb/dwc3/dwc3-st.c @@ -266,7 +266,7 @@ static int st_dwc3_probe(struct platform if (!child_pdev) { dev_err(dev, "failed to find dwc3 core device\n"); ret = -ENODEV; - goto err_node_put; + goto depopulate; } dwc3_data->dr_mode = usb_get_dr_mode(&child_pdev->dev); @@ -282,6 +282,7 @@ static int st_dwc3_probe(struct platform ret = st_dwc3_drd_init(dwc3_data); if (ret) { dev_err(dev, "drd initialisation failed\n"); + of_platform_depopulate(dev); goto undo_softreset; } @@ -291,6 +292,8 @@ static int st_dwc3_probe(struct platform platform_set_drvdata(pdev, dwc3_data); return 0; +depopulate: + of_platform_depopulate(dev); err_node_put: of_node_put(child); undo_softreset: