phy: rockchip-usb: Fix refcount leak in rockchip_init_usb_uart
Subsystems (2)
PATCH 1/1 phy: rockchip-usb: Fix refcount leak in rockchip_init_usb_uart
Fix a reference counter leak in rockchip_init_usb_uart() where of_node_put(np) was missing after of_find_matching_node_and_match().
Fixes 605df8af33a7 ("phy: rockchip-usb: add handler for usb-uart functionality")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/phy/rockchip/phy-rockchip-usb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/phy/rockchip/phy-rockchip-usb.c +2 -0
@@ -539,6 +539,7 @@ static int __init rockchip_init_usb_uart(void)if (!data->init_usb_uart) {pr_err ("%s: usb-uart not available on %s\n" , __func__, match->compatible); +of_node_put (np);return -ENOTSUPP ; }
@@ -547,6 +548,7 @@ static int __init rockchip_init_usb_uart(void) grf =syscon_node_to_regmap (np->parent);if (IS_ERR (grf)) grf =syscon_regmap_lookup_by_phandle (np,"rockchip,grf" ); +of_node_put (np);if (IS_ERR (grf)) {pr_err ("%s: Missing rockchip,grf property, %lu\n" , __func__,PTR_ERR (grf));
Signature · 1 line
2.39.5 (Apple Git-154)