Skip to content

Commit 791cd7a

Browse files
Stanley Changgregkh
authored andcommitted
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: 34c2004 ("usb: dwc3: add Realtek DHC RTD SoC dwc3 glue layer driver") Signed-off-by: Stanley Chang <[email protected]> Acked-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0583bc7 commit 791cd7a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/usb/dwc3/dwc3-rtk.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,13 @@ static enum usb_device_speed __get_dwc3_maximum_speed(struct device_node *np)
183183

184184
ret = of_property_read_string(dwc3_np, "maximum-speed", &maximum_speed);
185185
if (ret < 0)
186-
return USB_SPEED_UNKNOWN;
186+
goto out;
187187

188188
ret = match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed);
189189

190+
out:
191+
of_node_put(dwc3_np);
192+
190193
return (ret < 0) ? USB_SPEED_UNKNOWN : ret;
191194
}
192195

@@ -339,6 +342,9 @@ static int dwc3_rtk_probe_dwc3_core(struct dwc3_rtk *rtk)
339342

340343
switch_usb2_role(rtk, rtk->cur_role);
341344

345+
platform_device_put(dwc3_pdev);
346+
of_node_put(dwc3_node);
347+
342348
return 0;
343349

344350
err_pdev_put:

0 commit comments

Comments
 (0)