Skip to contentSkip to conversation

possible memory leak fix

PATCH In review MAEDA Naoaki 2 participants 2 messages Feb 18, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 possible memory leak fix

Hi,

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

Regards,
- Naoaki Maeda

arch/ia64/pci/pci.c +3 -1
diff -Naur linux-2.6.3.org/arch/ia64/pci/pci.c linux-2.6.3/arch/ia64/pci/pci.c
@@ -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;
 }
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · MAEDA Naoaki

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