Wei Yongjun
407ef1db40
usb: ftdi-elan: fix memory leak on device disconnect
[ Upstream commit 1646566b5e0c556f779180a8514e521ac735de1e ]
'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 10:53:58 +01:00
..
2020-12-21 13:30:08 +01:00
2020-09-17 18:52:40 +02:00
2020-11-06 12:06:58 +01:00
2020-09-22 10:37:19 +02:00
2019-11-11 14:29:39 +01:00
2019-08-09 07:55:44 +02:00
2019-08-09 07:55:44 +02:00
2020-06-24 15:01:24 +02:00
2017-11-04 11:55:38 +01:00
2017-11-04 11:55:38 +01:00
2017-11-04 11:55:38 +01:00
2022-01-27 10:53:58 +01:00
2019-12-10 13:11:22 +01:00
2021-11-18 14:03:51 +01:00
2017-11-04 11:55:38 +01:00
2020-07-21 13:41:57 +02:00
2020-07-09 16:47:00 +02:00
2020-12-21 13:30:06 +01:00
2020-08-18 11:55:23 +02:00
2020-02-12 11:01:55 -08:00
2021-06-03 09:00:34 +02:00
2020-03-04 10:56:26 +01:00
2020-09-04 16:53:57 +02:00
2020-09-04 16:53:51 +02:00
2020-04-16 14:32:47 +02:00
2020-08-28 09:48:33 +02:00
2019-08-09 07:55:45 +02:00
2020-07-21 13:41:57 +02:00
2021-06-03 09:00:32 +02:00
2021-01-12 20:18:20 +01:00