Re: [PATCH v2] edac: fix kobject refcount leak in edac_device_create_instance
From: Borislav Petkov
Date: Wed Jul 22 2026 - 15:18:47 EST
On Sun, Jun 28, 2026 at 09:21:55PM +0800, WenTao Liang wrote:
> kobject_get(&edac_dev->kobj) acquires a reference on main_kobj, but it is
> only released when kobject_init_and_add fails. The success path and the
> block-creation error path both return without calling
> kobject_put(main_kobj), leaking the edac_dev kobject reference. The
> main_kobj pointer is local and lost after function return.
>
> Suggested-by: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
> Fixes: bee33f22d7c3 ("clocksource/drivers/nxp-pit: Add NXP Automotive s32g2 / s32g3 support")
An EDAC patch fixes this?!?!
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: WenTao Liang <vulab@xxxxxxxxxxx>
> ---
> Changes in v2:
> - Fix patch format based on reviewer feedback
> ---
> drivers/edac/edac_device_sysfs.c | 1 +
> 1 file changed, 1 insertion(+)
Also:
https://sashiko.dev/#/patchset/20260628132155.45969-1-vulab%40iscas.ac.cn
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette