All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] possible memory leak fix
@ 2004-02-18  7:43 MAEDA Naoaki
  2004-02-18 19:16 ` David Mosberger
  0 siblings, 1 reply; 2+ messages in thread
From: MAEDA Naoaki @ 2004-02-18  7:43 UTC (permalink / raw)
  To: linux-ia64

Hi,

I found a possible memory leak problem in alloc_resource().
The following patch against 2.6.3 fix the problem.

Regards,
- Naoaki Maeda

diff -Naur linux-2.6.3.org/arch/ia64/pci/pci.c linux-2.6.3/arch/ia64/pci/pci.c
--- linux-2.6.3.org/arch/ia64/pci/pci.c	2004-02-18 12:57:46.000000000 +0900
+++ linux-2.6.3/arch/ia64/pci/pci.c	2004-02-18 16:36:13.736205500 +0900
@@ -153,8 +153,10 @@
 	res->end = end;
 	res->flags = flags;
 
-	if (insert_resource(root, res))
+	if (insert_resource(root, res))	{
+		kfree(res);
 		return -EBUSY;
+	}
 
 	return 0;
 }

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

* Re: [PATCH] possible memory leak fix
  2004-02-18  7:43 [PATCH] possible memory leak fix MAEDA Naoaki
@ 2004-02-18 19:16 ` David Mosberger
  0 siblings, 0 replies; 2+ messages in thread
From: David Mosberger @ 2004-02-18 19:16 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Wed, 18 Feb 2004 16:43:27 +0900 (JST), MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com> said:

  Naoaki> I found a possible memory leak problem in alloc_resource().
  Naoaki> The following patch against 2.6.3 fix the problem.

Looks correct to me.  Applied.

Thanks,

	--david

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

end of thread, other threads:[~2004-02-18 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-18  7:43 [PATCH] possible memory leak fix MAEDA Naoaki
2004-02-18 19:16 ` David Mosberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.