linux/drivers/usb
Hans de Goede 3a2a91a2d5 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: c6919d5e0c ("usb: roles: Add usb_role_switch_find_by_fwnode()")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210409124136.65591-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-09 16:07:03 +02:00
..
atm drivers: usb: atm: use pr_err() and pr_warn() instead of raw printk() 2020-12-09 15:22:51 +01:00
c67x00 usb/c67x00: Replace tasklet with work 2021-01-26 18:36:37 +01:00
cdns3 usb: cdnsp: Fixes incorrect value in ISOC TRB 2021-03-13 22:03:24 +08:00
chipidea usb: chipidea: tegra: Silence deferred probe error 2021-03-23 12:50:32 +01:00
class USB: cdc-acm: do not log successful probe on later errors 2021-03-23 13:27:13 +01:00
common usb: common: move function's kerneldoc next to its definition 2021-03-10 09:37:17 +01:00
core usb: core: hub: Fix PM reference leak in usb_port_resume() 2021-04-09 16:03:25 +02:00
dwc2 usb: dwc2: Add exit partial power down before removing driver 2021-04-09 15:16:39 +02:00
dwc3 usb: dwc3: xilinx: Remove the extra freeing of clocks 2021-04-09 16:05:32 +02:00
early usb: early: ehci-dbgp: convert to readl_poll_timeout_atomic() 2020-09-25 16:29:09 +02:00
gadget usb: gadget: tegra-xudc: Fix possible use-after-free in tegra_xudc_remove() 2021-04-09 16:02:33 +02:00
host usb: host: u132-hcd: use DEFINE_MUTEX() for mutex lock 2021-04-09 16:02:30 +02:00
image USB: microtek: use set_host_byte() 2020-09-16 12:42:10 +02:00
isp1760 usb: isp1760-hcd: convert to readl_poll_timeout_atomic() 2020-09-25 16:30:05 +02:00
misc usb: misc: usbsevseg: update to use usb_control_msg_send() 2021-03-28 13:41:27 +02:00
mon USB: mon: Use scnprintf() for avoiding potential buffer overflow 2020-03-12 09:49:28 +01:00
mtu3 usb: mtu3: drop CONFIG_OF 2021-03-26 14:47:19 +01:00
musb usb: musb: fix PM reference leak in musb_irq_work() 2021-04-09 16:02:44 +02:00
phy usb: phy: phy-mxs-usb: Use of_device_get_match_data() 2021-01-18 18:35:46 +01:00
renesas_usbhs usb: renesas_usbhs: fix error return code of usbhsf_pkt_handler() 2021-03-23 12:42:15 +01:00
roles usb: roles: Call try_module_get() from usb_role_switch_find_by_fwnode() 2021-04-09 16:07:03 +02:00
serial USB: serial: io_edgeport: fix memory leak in edge_startup 2021-03-09 09:05:37 +01:00
storage usb-storage: Add quirk to defeat Kindle's automatic unload 2021-03-17 21:30:15 +01:00
typec usb: typec: Link all ports during connector registration 2021-04-09 16:00:00 +02:00
usbip usbip: vhci_hcd fix shift out-of-bounds in vhci_hub_control() 2021-03-26 14:49:03 +01:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver 2020-12-29 12:36:13 +08:00
usb-skeleton.c