[PATCH] possible memory leak fix

From: MAEDA Naoaki <maeda.naoaki_at_jp.fujitsu.com>
Date: 2004-02-18 18:43:27
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;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Feb 18 02:52:04 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:22 EST