Re: [PATCH] m68k/PCI: Fix a memory leak in an error handling path

From: Markus Elfring
Date: Sat Apr 18 2020 - 16:00:43 EST


> If 'ioremap' fails, we must free 'bridge', as done in other error handling
> path bellow.

I suggest to improve this change description.

* Please avoid a typo.

* Is an imperative wording preferred?


â
> +++ b/arch/m68k/coldfire/pci.c
> @@ -216,8 +216,10 @@ static int __init mcf_pci_init(void)
â

I propose to move the pci_free_host_bridge() call for the desired
exception handling to the end of this function implementation.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=c0d73a868d9b411bd2d0c8e5ff9d98bfa8563cb1#n450

Regards,
Markus