diff options
| author | Hans de Goede <[email protected]> | 2021-04-09 14:41:36 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2021-04-09 16:07:03 +0200 |
| commit | 3a2a91a2d51761557843996a66098eb7182b48b4 (patch) | |
| tree | eb31bc4481d9b538c1947e76102dcbd5a311ecfc /tools/perf/scripts/python | |
| parent | 124b11cc4f6276e9e435802b160c368f35f59e1a (diff) | |
usb: roles: Call try_module_get() from usb_role_switch_find_by_fwnode()
usb_role_switch_find_by_fwnode() returns a reference to the role-switch
which must be put by calling usb_role_switch_put().
usb_role_switch_put() calls module_put(sw->dev.parent->driver->owner),
add a matching try_module_get() to usb_role_switch_find_by_fwnode(),
making it behave the same as the other usb_role_switch functions
which return a reference.
This avoids a WARN_ON being hit at kernel/module.c:1158 due to the
module-refcount going below 0.
Fixes: c6919d5e0cd1 ("usb: roles: Add usb_role_switch_find_by_fwnode()")
Cc: stable <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions