From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4E13F4582FF; Sat, 12 Sep 2026 10:47:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789210049; cv=none; b=AAwS2XUC2n+AAe/9SoiRvL6gsaPjR21d3IPKMLVFTUv+qzRPhp3m8VD8dd08uTVBIqPbkN4Z2Wb5FBejMcL0II1hI5MSWha8dwKomEgDLODjtXsX9/nCTjt9sLBT0wAfosoCoVl7f/he+enL8RfS7NAAbzebg3LlDcCdD4mCcNM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789210049; c=relaxed/simple; bh=0x4b9G78NfEsgDnn5XHptLq65mCaUf5mtZ4vHA0eMdw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rnhm4Syt+40tjKNx7UZeU5und4Gv6PgR21XMQfgfRRTSnzg1Udd8re8tRGOmQPqsWPZ9ddv7j/K5DHiGW5gR3W8A+IkZ4UDOnswI+WUvX35EaXEQd5yFDm6t4nR9ENdEiv1nntv1ekOziSJwUOhrOITXd8WQeA8jCBTmShYYjFE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ErYyXww7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ErYyXww7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFC321F000FF; Sat, 12 Sep 2026 10:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789210045; bh=bHPAeLrU7HrBRW224UCtrQuRdfuN98TR4kJnMzWtRmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ErYyXww7Fur+C02VjoG3wU5GBbPw7xSy0MfFpoIax9VVvLQVcLQI3ORrl77UKnTF3 RZAQ9ydDRlqZNvw6Ve7t3v5duNgHNUWetJy0urHV0YnXO33X1aAxcN7YIvsYPgSwDG 5GYZX0RIPPd/yftx3wI1oN8mJ/k+J5JeHnfZzLrI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Felix Gu , Philipp Zabel , Vinod Koul , Sasha Levin Subject: [PATCH 6.18 0946/1518] phy: sunplus: fix error handling in sp_uphy_init() Date: Sat, 12 Sep 2026 08:51:55 +0200 Message-ID: <20260912065644.855942396@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Gu [ Upstream commit 8b2683bc4cc18c581b7cd24f227cbe61abca7f4d ] Fix the error paths of sp_uphy_init() to undo exactly what each stage did: return directly if clk_prepare_enable() fails, release only the clock if reset_control_deassert() fails, and jump to err_reset if update_disc_vol() fails so the clock and reset are not leaked. Fixes: 99d9ccd97385 ("phy: usb: Add USB2.0 phy driver for Sunplus SP7021") Signed-off-by: Felix Gu Reviewed-by: Philipp Zabel Link: https://patch.msgid.link/20260803-sunplus-usb3-v1-1-5a562524c869@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/sunplus/phy-sunplus-usb2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/phy/sunplus/phy-sunplus-usb2.c b/drivers/phy/sunplus/phy-sunplus-usb2.c index 637a5fbae6d9a..0ad4c7160d17c 100644 --- a/drivers/phy/sunplus/phy-sunplus-usb2.c +++ b/drivers/phy/sunplus/phy-sunplus-usb2.c @@ -116,11 +116,11 @@ static int sp_uphy_init(struct phy *phy) ret = clk_prepare_enable(usbphy->phy_clk); if (ret) - goto err_clk; + return ret; ret = reset_control_deassert(usbphy->rstc); if (ret) - goto err_reset; + goto err_clk; /* Default value modification */ writel(HIGH_MASK_BITS | 0x4002, usbphy->moon4_regs + UPHY_CONTROL0); @@ -129,7 +129,7 @@ static int sp_uphy_init(struct phy *phy) /* disconnect voltage */ ret = update_disc_vol(usbphy); if (ret < 0) - return ret; + goto err_reset; /* board uphy 0 internal register modification for tid certification */ val = readl(usbphy->phy_regs + CONFIG9); -- 2.53.0