Re: [PATCH v2] selftests/livepatch: fix resource leak in test_klp_syscall init error path

From: Petr Mladek

Date: Thu Jun 04 2026 - 09:13:39 EST


On Thu 2026-06-04 16:32:08, Rui Qi wrote:
> In livepatch_init(), if klp_enable_patch() fails, the previously
> created kobject and sysfs file are never cleaned up, causing a
> resource leak. Capture the return value and add proper cleanup
> on the error path.
>
> Signed-off-by: Rui Qi <qirui.001@xxxxxxxxxxxxx>

The patch looks good to me. I would ignore the proble reported by
Sashiko. so:

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

Best Regards,
Petr

PS: I am going to push this patch early next week if nobody complained
in the meantime.