aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanley Chang <stanley_chang@realtek.com>2023-11-17 15:03:05 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-21 15:30:43 +0100
commit791cd7afe51b0c770264836ab0607766e3e80f52 (patch)
treed5feb1724d7b8c381979deec05cee48056da470a
parent0583bc776ca5b5a3f5752869fc31cf7322df2b35 (diff)
downloadlibata-791cd7afe51b0c770264836ab0607766e3e80f52.tar.gz
usb: dwc3: add missing of_node_put and platform_device_put
of_get_compatible_child performs an of_node_get, so an of_node_put is required. Add platform_device_put to match with of_find_device_by_node. Fixes: 34c200483569 ("usb: dwc3: add Realtek DHC RTD SoC dwc3 glue layer driver") Signed-off-by: Stanley Chang <stanley_chang@realtek.com> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/20231117070311.32502-1-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/dwc3/dwc3-rtk.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-rtk.c b/drivers/usb/dwc3/dwc3-rtk.c
index 590028e8fdcb23..3cd6b184551ce2 100644
--- a/drivers/usb/dwc3/dwc3-rtk.c
+++ b/drivers/usb/dwc3/dwc3-rtk.c
@@ -183,10 +183,13 @@ static enum usb_device_speed __get_dwc3_maximum_speed(struct device_node *np)
ret = of_property_read_string(dwc3_np, "maximum-speed", &maximum_speed);
if (ret < 0)
- return USB_SPEED_UNKNOWN;
+ goto out;
ret = match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed);
+out:
+ of_node_put(dwc3_np);
+
return (ret < 0) ? USB_SPEED_UNKNOWN : ret;
}
@@ -339,6 +342,9 @@ static int dwc3_rtk_probe_dwc3_core(struct dwc3_rtk *rtk)
switch_usb2_role(rtk, rtk->cur_role);
+ platform_device_put(dwc3_pdev);
+ of_node_put(dwc3_node);
+
return 0;
err_pdev_put: