linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] m68k/PCI: Fix a memory leak in an error handling path
@ 2020-04-18 20:00 Markus Elfring
  2020-04-18 20:55 ` Christophe JAILLET
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Elfring @ 2020-04-18 20:00 UTC (permalink / raw)
  To: Christophe Jaillet, linux-m68k
  Cc: kernel-janitors, linux-kernel, Bjorn Helgaas, Geert Uytterhoeven,
	Greg Ungerer, Lorenzo Pieralisi

> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68k/PCI: Fix a memory leak in an error handling path
  2020-04-18 20:00 [PATCH] m68k/PCI: Fix a memory leak in an error handling path Markus Elfring
@ 2020-04-18 20:55 ` Christophe JAILLET
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2020-04-18 20:55 UTC (permalink / raw)
  To: Markus Elfring, linux-m68k
  Cc: kernel-janitors, linux-kernel, Bjorn Helgaas, Geert Uytterhoeven,
	Greg Ungerer, Lorenzo Pieralisi

Le 18/04/2020 à 22:00, Markus Elfring a écrit :
>> If 'ioremap' fails, we must free 'bridge', as done in other error handling
>> path bellow.
> I suggest to improve this change description.

I suggest you stop proposing over and over useless comments.
Please just ignore my proposals as I do for your boring, never 
constructing, replies.


> * Please avoid a typo.
>
> * Is an imperative wording preferred?
>
* is Melissa still around?

> …
>> +++ 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

I propose to let patch submitter and maintainer decide about it.
I don't need your point of view. I guess that maintainers don't either.

No need to waste time trying to engage any discussion with me.
This is the first and very last exchange we will ever have.

Best regards,
CJ


> 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
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68k/PCI: Fix a memory leak in an error handling path
  2020-04-18  7:07 Christophe JAILLET
  2020-04-20  7:08 ` Geert Uytterhoeven
@ 2020-04-21  7:12 ` Greg Ungerer
  1 sibling, 0 replies; 5+ messages in thread
From: Greg Ungerer @ 2020-04-21  7:12 UTC (permalink / raw)
  To: Christophe JAILLET, geert, bhelgaas, lorenzo.pieralisi
  Cc: linux-m68k, linux-kernel, kernel-janitors

Hi Christophe,

On 18/4/20 5:07 pm, Christophe JAILLET wrote:
> If 'ioremap' fails, we must free 'bridge', as done in other error handling
> path bellow.
> 
> Fixes: 19cc4c843f40 ("m68k/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Looks good, thanks.
I will queue this in the for-next branch of the m68knommu tree.

Regards
Greg


> ---
>   arch/m68k/coldfire/pci.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/m68k/coldfire/pci.c b/arch/m68k/coldfire/pci.c
> index 62b0eb6cf69a..84eab0f5e00a 100644
> --- a/arch/m68k/coldfire/pci.c
> +++ b/arch/m68k/coldfire/pci.c
> @@ -216,8 +216,10 @@ static int __init mcf_pci_init(void)
>   
>   	/* Keep a virtual mapping to IO/config space active */
>   	iospace = (unsigned long) ioremap(PCI_IO_PA, PCI_IO_SIZE);
> -	if (iospace == 0)
> +	if (iospace == 0) {
> +		pci_free_host_bridge(bridge);
>   		return -ENODEV;
> +	}
>   	pr_info("Coldfire: PCI IO/config window mapped to 0x%x\n",
>   		(u32) iospace);
>   
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68k/PCI: Fix a memory leak in an error handling path
  2020-04-18  7:07 Christophe JAILLET
@ 2020-04-20  7:08 ` Geert Uytterhoeven
  2020-04-21  7:12 ` Greg Ungerer
  1 sibling, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2020-04-20  7:08 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Greg Ungerer, Bjorn Helgaas, Lorenzo Pieralisi, linux-m68k,
	Linux Kernel Mailing List, kernel-janitors

On Sat, Apr 18, 2020 at 9:07 AM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
> If 'ioremap' fails, we must free 'bridge', as done in other error handling
> path bellow.
>
> Fixes: 19cc4c843f40 ("m68k/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] m68k/PCI: Fix a memory leak in an error handling path
@ 2020-04-18  7:07 Christophe JAILLET
  2020-04-20  7:08 ` Geert Uytterhoeven
  2020-04-21  7:12 ` Greg Ungerer
  0 siblings, 2 replies; 5+ messages in thread
From: Christophe JAILLET @ 2020-04-18  7:07 UTC (permalink / raw)
  To: gerg, geert, bhelgaas, lorenzo.pieralisi
  Cc: linux-m68k, linux-kernel, kernel-janitors, Christophe JAILLET

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

Fixes: 19cc4c843f40 ("m68k/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 arch/m68k/coldfire/pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/m68k/coldfire/pci.c b/arch/m68k/coldfire/pci.c
index 62b0eb6cf69a..84eab0f5e00a 100644
--- a/arch/m68k/coldfire/pci.c
+++ b/arch/m68k/coldfire/pci.c
@@ -216,8 +216,10 @@ static int __init mcf_pci_init(void)
 
 	/* Keep a virtual mapping to IO/config space active */
 	iospace = (unsigned long) ioremap(PCI_IO_PA, PCI_IO_SIZE);
-	if (iospace == 0)
+	if (iospace == 0) {
+		pci_free_host_bridge(bridge);
 		return -ENODEV;
+	}
 	pr_info("Coldfire: PCI IO/config window mapped to 0x%x\n",
 		(u32) iospace);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-21  7:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18 20:00 [PATCH] m68k/PCI: Fix a memory leak in an error handling path Markus Elfring
2020-04-18 20:55 ` Christophe JAILLET
  -- strict thread matches above, loose matches on Subject: below --
2020-04-18  7:07 Christophe JAILLET
2020-04-20  7:08 ` Geert Uytterhoeven
2020-04-21  7:12 ` Greg Ungerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).