forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/usb/roles/class.c
....@@ -106,10 +106,13 @@
106106 struct fwnode_handle *parent = fwnode_get_parent(fwnode);
107107 struct device *dev;
108108
109
- if (!parent || !fwnode_property_present(parent, "usb-role-switch"))
109
+ if (!fwnode_property_present(parent, "usb-role-switch")) {
110
+ fwnode_handle_put(parent);
110111 return NULL;
112
+ }
111113
112114 dev = class_find_device_by_fwnode(role_class, parent);
115
+ fwnode_handle_put(parent);
113116 return dev ? to_role_switch(dev) : ERR_PTR(-EPROBE_DEFER);
114117 }
115118