linux-stable/drivers/usb
Wei Yongjun 6d88a68496 usb: ftdi-elan: fix memory leak on device disconnect
[ Upstream commit 1646566b5e ]

'ftdi' is alloced when probe device, but not free on device disconnect,
this cause a memory leak as follows:

unreferenced object 0xffff88800d584000 (size 8400):
  comm "kworker/0:2", pid 3809, jiffies 4295453055 (age 13.784s)
  hex dump (first 32 bytes):
    00 40 58 0d 80 88 ff ff 00 40 58 0d 80 88 ff ff  .@X......@X.....
    00 00 00 00 00 00 00 00 00 00 00 00 ad 4e ad de  .............N..
  backtrace:
    [<000000000d47f947>] kmalloc_order_trace+0x19/0x110 mm/slab_common.c:960
    [<000000008548ac68>] ftdi_elan_probe+0x8c/0x880 drivers/usb/misc/ftdi-elan.c:2647
    [<000000007f73e422>] usb_probe_interface+0x31b/0x800 drivers/usb/core/driver.c:396
    [<00000000fe8d07fc>] really_probe+0x299/0xc30 drivers/base/dd.c:517
    [<0000000005da7d32>] __driver_probe_device+0x357/0x500 drivers/base/dd.c:751
    [<000000003c2c9579>] driver_probe_device+0x4e/0x140 drivers/base/dd.c:781

Fix it by freeing 'ftdi' after nobody use it.

Fixes: a5c66e4b24 ("USB: ftdi-elan: client driver for ELAN Uxxx adapters")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20211217083428.2441-1-weiyongjun1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 11:03:40 +01:00
..
atm usb: atm: cxacru: Fix typo in comment 2021-05-21 20:05:40 +02:00
c67x00
cdns3 usb: cdnsp: Fix lack of spin_lock_irqsave/spin_lock_restore 2021-12-22 09:32:46 +01:00
chipidea usb: chipidea: ci_hdrc_imx: fix potential error pointer dereference in probe 2021-12-01 09:04:40 +01:00
class USB: cdc-acm: fix break reporting 2021-10-05 13:50:52 +02:00
common Partially revert "usb: Kconfig: using select for USB_COMMON dependency" 2021-10-05 13:45:16 +02:00
core USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status 2022-01-16 09:12:43 +01:00
dwc2 usb: dwc2: fix STM ID/VBUS detection startup delay in dwc2_driver_probe 2021-12-22 09:32:46 +01:00
dwc3 Revert "usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default" 2021-12-14 10:57:19 +01:00
early Revert "usb: early: convert to readl_poll_timeout_atomic()" 2021-12-22 09:32:45 +01:00
gadget usb: gadget: f_fs: Clear ffs_eventfd in ffs_data_clear. 2022-01-05 12:42:38 +01:00
host xhci: Fresco FL1100 controller should not have BROKEN_MSI quirk set. 2022-01-05 12:42:38 +01:00
image
isp1760 usb: isp1760: otg control register access 2021-08-27 16:11:39 +02:00
misc usb: ftdi-elan: fix memory leak on device disconnect 2022-01-27 11:03:40 +01:00
mon
mtu3 usb: mtu3: fix interval value for intr and isoc 2022-01-11 15:35:17 +01:00
musb usb: musb: tusb6010: check return value after calling platform_get_resource() 2021-11-25 09:48:25 +01:00
phy usb: phy: tahvo: add IRQ check 2021-08-16 18:57:19 +02:00
renesas_usbhs usb: renesas_usbhs: Fix spelling mistake "faile" -> "failed" 2021-08-27 10:29:32 +02:00
roles usb: roles: add helper usb_role_string() 2021-05-27 09:17:18 +02:00
serial USB: serial: option: add Telit FN990 compositions 2021-12-22 09:32:47 +01:00
storage usb-storage: Add compatibility quirk flags for iODD 2531/2541 2021-11-12 15:05:48 +01:00
typec usb: typec: tcpm: fix tcpm unregister port but leave a pending timer 2021-12-22 09:32:47 +01:00
usbip usbip:vhci_hcd USB port can get stuck in the disabled state 2021-08-26 13:29:27 +02:00
Kconfig usb: remove reference to deleted config STB03xxx 2021-08-18 15:32:19 +02:00
Makefile usb: host: remove line for obsolete config USB_HWA_HCD 2021-08-18 15:32:19 +02:00
usb-skeleton.c