usb: host: ehci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths
Subsystems (4)
Krzysztof Kozlowski
maintainerPATCH 1/2 usb: host: ehci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths
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.
--- drivers/usb/host/ehci-exynos.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/host/ehci-exynos.c +2 -0
@@ -77,10 +77,12 @@ static int exynos_ehci_get_phy(struct device *dev,if (IS_ERR (phy)) { ret =PTR_ERR (phy);if (ret == -EPROBE_DEFER ) { +of_node_put (child);return ret; }else if (ret != -ENOSYS && ret != -ENODEV ) {dev_err (dev,"Error retrieving usb2 phy: %d\n" , ret); +of_node_put (child);return ret; } }
Signature · 1 line
2.9.3
Krzysztof Kozlowski
maintainerPATCH 2/2 usb: host: ohci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths
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.
--- drivers/usb/host/ohci-exynos.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/host/ohci-exynos.c +2 -0
@@ -66,10 +66,12 @@ static int exynos_ohci_get_phy(struct device *dev,if (IS_ERR (phy)) { ret =PTR_ERR (phy);if (ret == -EPROBE_DEFER ) { +of_node_put (child);return ret; }else if (ret != -ENOSYS && ret != -ENODEV ) {dev_err (dev,"Error retrieving usb2 phy: %d\n" , ret); +of_node_put (child);return ret; } }
Signature · 1 line
2.9.3
Re: [PATCH 2/2] usb: host: ohci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths
Hello Krzysztof,
Quoted 7 lines · Krzysztof Kozlowski
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 6d40500ac9b6 ("usb: ehci/ohci-exynos: Fix of_node_put() for child when getting PHYs")Signed-off-by Krzysztof Kozlowski <[email protected]>---
Best regards,
Signature · 3 lines
Javier Martinez Canillas Open Source Group Samsung Research America
Re: [PATCH 2/2] usb: host: ohci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths
In reply to Krzysztof KozlowskiQuoted 17 lines · Krzysztof Kozlowski
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 6d40500ac9b6 ("usb: ehci/ohci-exynos: Fix of_node_put() for child when getting PHYs")Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/usb/host/ohci-exynos.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/host/ohci-exynos.c +0
-0@@ -66,10 +66,12 @@ static int exynos_ohci_get_phy(struct device *dev,if (IS_ERR (phy)) { ret =PTR_ERR (phy);
drivers/usb/host/ohci-exynos.c static int exynos_ohci_get_phy(struct device *dev, · line 77
Quoted 10 lines
drivers/usb/host/ohci-exynos.c +2
-0if (ret == -EPROBE_DEFER ) { +of_node_put (child);return ret; }else if (ret != -ENOSYS && ret != -ENODEV ) {dev_err (dev,"Error retrieving usb2 phy: %d\n" , ret); +of_node_put (child);return ret; } }
Hello Krzysztof,
Quoted 7 lines · Krzysztof Kozlowski
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 6d40500ac9b6 ("usb: ehci/ohci-exynos: Fix of_node_put() for child when getting PHYs")Signed-off-by Krzysztof Kozlowski <[email protected]>---
Best regards,
Signature · 3 lines
Javier Martinez Canillas Open Source Group Samsung Research America
Quoted 18 lines · Krzysztof Kozlowski
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 6d40500ac9b6 ("usb: ehci/ohci-exynos: Fix of_node_put() for child when getting PHYs")Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/usb/host/ehci-exynos.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/host/ehci-exynos.c +0
-0@@ -77,10 +77,12 @@ static int exynos_ehci_get_phy(struct device *dev,if (IS_ERR (phy)) { ret =PTR_ERR (phy);
drivers/usb/host/ehci-exynos.c static int exynos_ehci_get_phy(struct device *dev, · line 88
Quoted 10 lines
drivers/usb/host/ehci-exynos.c +2
-0if (ret == -EPROBE_DEFER ) { +of_node_put (child);return ret; }else if (ret != -ENOSYS && ret != -ENODEV ) {dev_err (dev,"Error retrieving usb2 phy: %d\n" , ret); +of_node_put (child);return ret; } }