On Tue, Jun 21, 2022 at 10:29 PM Terry Bowman <Terry.Bowman@xxxxxxx> wrote: > > > > On 6/21/22 07:48, Jean Delvare wrote: > > > Yi Zhang, can you please test this patch and confirm that it solves the > > memory leak? Yes, it was fixed by your patch, feel free to add Tested-by: Yi Zhang <yi.zhang@xxxxxxxxxx> > > > > Terry, please review/comment. > > > > If my analysis is correct then the sp5100_wdt and thinkpad_acpi drivers > > suffer from a similar leak and need to be fixed the same way. > > > > Hi Jean, > > Your analysis is correct. The kfree() call is missing during the release in i2c-piix4 and > sp5100_tco driver patches. Let me know if there is anything I can do. I guess I reproduced you mentioned sp5100_tco driver mem leak? unreferenced object 0xffff8882aa28e580 (size 64): comm "systemd-udevd", pid 909, jiffies 4294723115 (age 1091.326s) hex dump (first 32 bytes): 00 03 d8 fe 00 00 00 00 07 03 d8 fe 00 00 00 00 ................ 60 a3 83 c0 ff ff ff ff 00 02 40 80 00 00 00 00 `.........@..... backtrace: [<0000000000f660c7>] kmem_cache_alloc_trace+0x169/0x2a0 [<0000000072801446>] __request_region+0x52/0xb0 [<00000000b6580dac>] sp5100_tco_probe+0x5c7/0x98e [sp5100_tco] [<00000000a4d2b832>] platform_probe+0xad/0x200 [<00000000de5f0bc2>] really_probe+0x389/0x9b0 [<0000000066128dc6>] __driver_probe_device+0x2bc/0x470 [<00000000c11a18e4>] driver_probe_device+0x4a/0x120 [<0000000030500515>] __device_attach_driver+0x1b3/0x280 [<000000003bdf095d>] bus_for_each_drv+0x11f/0x1b0 [<00000000c321e46b>] __device_attach+0x205/0x3c0 [<000000003d858a16>] bus_probe_device+0x1a6/0x260 [<000000005df24665>] device_add+0xa2c/0x1ae0 [<000000000ce86b32>] platform_device_add+0x2c2/0x710 [<000000009c49c0a6>] platform_device_register_full+0x34b/0x470 [<00000000cfb75755>] 0xffffffffc08e80fa [<000000002fe1be8f>] do_one_initcall+0xfb/0x580 (gdb) l *(sp5100_tco_probe+0x5c7) 0xc17 is in sp5100_tco_probe (drivers/watchdog/sp5100_tco.c:349). 344 struct resource *res; 345 void __iomem *addr; 346 int ret; 347 u32 val; 348 349 res = request_mem_region_muxed(EFCH_PM_ACPI_MMIO_PM_ADDR, 350 EFCH_PM_ACPI_MMIO_PM_SIZE, 351 "sp5100_tco"); 352 353 if (!res) { > -- Best Regards, Yi Zhang