Re: [PATCH] efi: fix memory leak in efi_mem_reserve_iomem()

From: Markus Elfring

Date: Sun Dec 06 2026 - 03:37:19 EST


> Hi efi subsystem,

Please take another look at information for the canonical patch format.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.4-rc5#n640

Greetings are probably not needed there.


> I reading the code of efi.c and, is noted a small memory leak:
>
> In this line:
>
> ret = parent ? request_resource(parent, res) : 0;
>
> If ret == 0, is success. But, if not is 0 (ret != 0) ? This patch added a verification
> to this case, removing res for evits a memory leak and return the ret.

Would an imperative wording approach be preferred for an improved change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.4-rc5#n94

Would you like to add error detection and the corresponding exception handling
according to a failed request_resource() call in another function implementation?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v7.4-rc5#n526

Regards,
Markus