aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/ibmphp_pci.c
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-11-16 20:19:25 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-01 17:37:00 -0500
commitb0d974e90d6f9fbf3a926defbbc76543cff74426 (patch)
tree02311da0df99efe54718c8a54727980629569161 /drivers/pci/hotplug/ibmphp_pci.c
parent9d167dc367f22c07285137370816b83b4be9c697 (diff)
PCI: ibmphp_pci.c: fix NULL dereference
The correct order is: NULL check before dereference Spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_pci.c')
-rw-r--r--drivers/pci/hotplug/ibmphp_pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
index d87a9e3eaeeb..d8f05d7a3c72 100644
--- a/drivers/pci/hotplug/ibmphp_pci.c
+++ b/drivers/pci/hotplug/ibmphp_pci.c
@@ -1371,12 +1371,12 @@ static int unconfigure_boot_bridge (u8 busno, u8 device, u8 function)
1371 } 1371 }
1372 1372
1373 bus = ibmphp_find_res_bus (sec_number); 1373 bus = ibmphp_find_res_bus (sec_number);
1374 debug ("bus->busno is %x\n", bus->busno);
1375 debug ("sec_number is %x\n", sec_number);
1376 if (!bus) { 1374 if (!bus) {
1377 err ("cannot find Bus structure for the bridged device\n"); 1375 err ("cannot find Bus structure for the bridged device\n");
1378 return -EINVAL; 1376 return -EINVAL;
1379 } 1377 }
1378 debug("bus->busno is %x\n", bus->busno);
1379 debug("sec_number is %x\n", sec_number);
1380 1380
1381 ibmphp_remove_bus (bus, busno); 1381 ibmphp_remove_bus (bus, busno);
1382 1382