Skip to content

Commit

Permalink
[POWERPC] allocation fix in ppc/platforms/4xx/luan.c
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
  • Loading branch information
Roel Kluin authored and Josh Boyer committed Nov 1, 2007
1 parent d1dfc35 commit 57d7556
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/ppc/platforms/4xx/luan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 57d7556

Please sign in to comment.