From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Wentao Liang <vulab@iscas.ac.cn>,
Neil Armstrong <neil.armstrong@linaro.org>,
Vinod Koul <vkoul@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1.y 3/3] phy: rockchip: inno-usb2: Fix a double free bug in rockchip_usb2phy_probe()
Date: Tue, 20 Jan 2026 21:13:33 -0500 [thread overview]
Message-ID: <20260121021333.1126769-3-sashal@kernel.org> (raw)
In-Reply-To: <20260121021333.1126769-1-sashal@kernel.org>
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit e07dea3de508cd6950c937cec42de7603190e1ca ]
The for_each_available_child_of_node() calls of_node_put() to
release child_np in each success loop. After breaking from the
loop with the child_np has been released, the code will jump to
the put_child label and will call the of_node_put() again if the
devm_request_threaded_irq() fails. These cause a double free bug.
Fix by returning directly to avoid the duplicate of_node_put().
Fixes: ed2b5a8e6b98 ("phy: phy-rockchip-inno-usb2: support muxed interrupts")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260109154626.2452034-1-vulab@iscas.ac.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 03a1d1453c311..3a7e825a81b35 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -1326,7 +1326,7 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
rphy);
if (ret) {
dev_err_probe(rphy->dev, ret, "failed to request usb2phy irq handle\n");
- goto put_child;
+ return ret;
}
}
--
2.51.0
prev parent reply other threads:[~2026-01-21 2:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 13:00 FAILED: patch "[PATCH] phy: rockchip: inno-usb2: Fix a double free bug in" failed to apply to 6.1-stable tree gregkh
2026-01-21 2:13 ` [PATCH 6.1.y 1/3] phy: phy-rockchip-inno-usb2: simplify phy clock handling Sasha Levin
2026-01-21 2:13 ` [PATCH 6.1.y 2/3] phy: phy-rockchip-inno-usb2: Use dev_err_probe() in the probe path Sasha Levin
2026-01-21 2:13 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260121021333.1126769-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=stable@vger.kernel.org \
--cc=vkoul@kernel.org \
--cc=vulab@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox