[POWERPC] allocation fix in ppc/platforms/4xx/luan.c
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>
This commit is contained in:
@@ -230,10 +230,15 @@ luan_setup_hoses(void)
|
|||||||
|
|
||||||
/* Allocate hoses for PCIX1 and PCIX2 */
|
/* Allocate hoses for PCIX1 and PCIX2 */
|
||||||
hose1 = pcibios_alloc_controller();
|
hose1 = pcibios_alloc_controller();
|
||||||
hose2 = pcibios_alloc_controller();
|
if (!hose1)
|
||||||
if (!hose1 || !hose2)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
hose2 = pcibios_alloc_controller();
|
||||||
|
if (!hose2) {
|
||||||
|
pcibios_free_controller(hose1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Setup PCIX1 */
|
/* Setup PCIX1 */
|
||||||
hose1->first_busno = 0;
|
hose1->first_busno = 0;
|
||||||
hose1->last_busno = 0xff;
|
hose1->last_busno = 0xff;
|
||||||
|
Reference in New Issue
Block a user