Armin Wolf
04bb8af40a
pcmcia: rsrc_nonstatic: Fix memory leak in nonstatic_release_resource_db()
...
[ Upstream commit c85fd9422fe0f5d667305efb27f56d09eab120b0 ]
When nonstatic_release_resource_db() frees all resources associated
with an PCMCIA socket, it forgets to free socket_data too, causing
a memory leak observable with kmemleak:
unreferenced object 0xc28d1000 (size 64):
comm "systemd-udevd", pid 297, jiffies 4294898478 (age 194.484s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 f0 85 0e c3 00 00 00 00 ................
00 00 00 00 0c 10 8d c2 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffda4245>] __kmem_cache_alloc_node+0x2d7/0x4a0
[<7e51f0c8>] kmalloc_trace+0x31/0xa4
[<d52b4ca0>] nonstatic_init+0x24/0x1a4 [pcmcia_rsrc]
[<a2f13e08>] pcmcia_register_socket+0x200/0x35c [pcmcia_core]
[<a728be1b>] yenta_probe+0x4d8/0xa70 [yenta_socket]
[<c48fac39>] pci_device_probe+0x99/0x194
[<84b7c690>] really_probe+0x181/0x45c
[<8060fe6e>] __driver_probe_device+0x75/0x1f4
[<b9b76f43>] driver_probe_device+0x28/0xac
[<648b766f>] __driver_attach+0xeb/0x1e4
[<6e9659eb>] bus_for_each_dev+0x61/0xb4
[<25a669f3>] driver_attach+0x1e/0x28
[<d8671d6b>] bus_add_driver+0x102/0x20c
[<df0d323c>] driver_register+0x5b/0x120
[<942cd8a4>] __pci_register_driver+0x44/0x4c
[<e536027e>] __UNIQUE_ID___addressable_cleanup_module188+0x1c/0xfffff000 [iTCO_vendor_support]
Fix this by freeing socket_data too.
Tested on a Acer Travelmate 4002WLMi by manually binding/unbinding
the yenta_cardbus driver (yenta_socket).
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Message-ID: <20230512184529.5094-1-W_Armin@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-26 15:26:45 +02:00
..
2019-05-30 11:26:32 -07:00
2017-11-04 12:03:13 +01:00
2019-11-22 07:03:04 +01:00
2019-11-22 07:03:04 +01:00
2020-05-18 11:16:39 +02:00
2022-01-27 10:54:03 +01:00
2020-08-23 17:36:59 -05:00
2020-09-25 06:12:15 +02:00
2020-06-02 10:59:10 -07:00
2021-08-12 13:22:16 +02:00
2019-12-16 11:49:54 +01:00
2017-11-04 12:03:13 +01:00
2022-06-14 18:32:30 +02:00
2018-12-04 22:37:38 +00:00
2018-12-04 22:37:38 +00:00
2018-12-04 22:37:38 +00:00
2020-03-14 14:32:02 +01:00
2020-05-18 11:16:39 +02:00
2019-06-19 17:09:55 +02:00
2018-06-12 16:19:22 -07:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:30:27 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2018-10-01 12:17:03 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2023-08-26 15:26:45 +02:00
2018-04-06 15:53:22 +01:00
2018-04-06 15:53:22 +01:00
2018-03-24 14:17:09 +00:00
2020-03-31 18:48:22 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2018-12-04 22:37:38 +00:00
2019-06-19 17:09:55 +02:00
2018-12-04 22:37:38 +00:00
2018-09-13 11:16:54 +02:00
2020-03-28 07:52:13 +01:00
2019-06-19 17:09:55 +02:00
2017-11-04 12:03:13 +01:00
2019-05-30 11:26:35 -07:00
2019-05-21 10:50:45 +02:00
2020-05-21 15:53:07 -05:00