Commit 08fd577b authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Sasha Levin

usb: host: ehci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths

[ Upstream commit 3f6026b1 ]

Returning from for_each_available_child_of_node() loop requires cleaning
up node refcount.  Error paths lacked it so for example in case of
deferred probe, the refcount of phy node was left increased.

Fixes: 6d40500a ("usb: ehci/ohci-exynos: Fix of_node_put() for child when getting PHYs")
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Reviewed-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent 0a9f0af4
...@@ -77,10 +77,12 @@ static int exynos_ehci_get_phy(struct device *dev, ...@@ -77,10 +77,12 @@ static int exynos_ehci_get_phy(struct device *dev,
if (IS_ERR(phy)) { if (IS_ERR(phy)) {
ret = PTR_ERR(phy); ret = PTR_ERR(phy);
if (ret == -EPROBE_DEFER) { if (ret == -EPROBE_DEFER) {
of_node_put(child);
return ret; return ret;
} else if (ret != -ENOSYS && ret != -ENODEV) { } else if (ret != -ENOSYS && ret != -ENODEV) {
dev_err(dev, dev_err(dev,
"Error retrieving usb2 phy: %d\n", ret); "Error retrieving usb2 phy: %d\n", ret);
of_node_put(child);
return ret; return ret;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment