On Sun, Oct 31, 2021 at 11:07 AM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: > > When registering the IRQ handler fails, do not just return the error code, > this will free the devm_kalloc-ed data struct while leaving the queued devm_kzalloc()-ed? (main point is z/m/etc in the function name) > work queued and the registered power_supply registered with both of them > now pointing to free-ed memory, resulting in various kernel crashes > soon afterwards. > > Instead properly tear-down things on IRQ handler register errors. -- With Best Regards, Andy Shevchenko