Re: [PATCH v3 17/17] tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure

From: Markus Elfring

Date: Mon Mar 16 2026 - 08:22:14 EST


> If fstat() fails after open() succeeds, load_xbc_file() returns
> -errno without closing the file descriptor. Add the missing close()
> call on the error path.

https://elixir.bootlin.com/linux/v7.0-rc3/source/tools/bootconfig/main.c#L139-L153

How do you think about to use a corresponding goto chain?


Would you like to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.0-rc4#n145

Regards,
Markus