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 3EBA11DFD1; Sun, 1 Sep 2024 17:08:50 +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=1725210531; cv=none; b=rtrWYM+UWFv0ApxNim9a4BXnmmpA1/jfANQvUTQFAUhcR9TCvGP9lfiifsRPbEy8kCqZMsOMVz/L1VcrlW4b/+GuUyxLE2HTFeCrzamc7KI/hZ5V5w830yNEYCCZM/nmAVXGIMPgkMfxjeIZIkHk4lXSq/CWfyCrihnePBliCE4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725210531; c=relaxed/simple; bh=NYXi1kwNrcYW1LaEd6ikViX+u5uAHfikt0+3lX0SSVw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D1BRk/4Yyf8G9DpsRlmB3zEVZHPcUt3cw5ISsuFZCPt58/XZAUk2nbU7DacNTCY8S0erKpg4ObA5Zn/b2Jb4mKJUaYjpUYP2U6PwHt3grBUOU3CLsiWTLr6bF/fgA16WOiuNyaFxHewzZoh9kTe8sgvL4yoaN4RmgosS9+pV7UU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PIjKeRjQ; 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="PIjKeRjQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BE95C4CEC3; Sun, 1 Sep 2024 17:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725210530; bh=NYXi1kwNrcYW1LaEd6ikViX+u5uAHfikt0+3lX0SSVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PIjKeRjQAdnINSpG6SqFku48sPxD+wf7BUph2q/dJZRahPfN0Yh7TsBaQnz56DJoy +zghTJxfB9jOb2LeEWN5HwemsFkk7SwHKLQdv/mYDERH73IyAFMOm80OV7QArTwvoC 1QwXwP4frcGobeLBaeFvz313iobdfa6z7dDzPJyc= 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 5.15 207/215] usb: dwc3: st: add missing depopulate in probe error path Date: Sun, 1 Sep 2024 18:18:39 +0200 Message-ID: <20240901160831.176461761@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240901160823.230213148@linuxfoundation.org> References: <20240901160823.230213148@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev 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: 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: