* [PATCH] allocation fix in ppc/platforms/4xx/luan.c
@ 2007-10-27 14:22 Roel Kluin
0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2007-10-27 14:22 UTC (permalink / raw)
To: linuxppc-dev
Don't allocate hose2 when when hose1 can't be allocated and free hose1 when
hose2 can't be allocated.
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/ppc/platforms/4xx/luan.c b/arch/ppc/platforms/4xx/luan.c
index 4b16961..b79ebb8 100644
--- a/arch/ppc/platforms/4xx/luan.c
+++ b/arch/ppc/platforms/4xx/luan.c
@@ -230,9 +230,14 @@ luan_setup_hoses(void)
/* Allocate hoses for PCIX1 and PCIX2 */
hose1 = pcibios_alloc_controller();
+ if (!hose1)
+ return;
+
hose2 = pcibios_alloc_controller();
- if (!hose1 || !hose2)
+ if (!hose2) {
+ pcibios_free_controller(hose1);
return;
+ }
/* Setup PCIX1 */
hose1->first_busno = 0;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-10-27 14:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-27 14:22 [PATCH] allocation fix in ppc/platforms/4xx/luan.c Roel Kluin
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).