kernel/drivers/usb/roles/class.c
.. .. @@ -106,10 +106,13 @@ 106 106 struct fwnode_handle *parent = fwnode_get_parent(fwnode); 107 107 struct device *dev; 108 108 109 - if (!parent || !fwnode_property_present(parent, "usb-role-switch"))109 + if (!fwnode_property_present(parent, "usb-role-switch")) {110 + fwnode_handle_put(parent);110 111 return NULL; 112 + }111 113 112 114 dev = class_find_device_by_fwnode(role_class, parent); 115 + fwnode_handle_put(parent);113 116 return dev ? to_role_switch(dev) : ERR_PTR(-EPROBE_DEFER); 114 117 } 115 118