Skip to content

Commit

Permalink
PCI: ibmphp_pci.c: fix NULL dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adrian Bunk authored and Greg Kroah-Hartman committed Dec 1, 2006
1 parent 9d167dc commit b0d974e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/hotplug/ibmphp_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1371,12 +1371,12 @@ static int unconfigure_boot_bridge (u8 busno, u8 device, u8 function)
}

bus = ibmphp_find_res_bus (sec_number);
debug ("bus->busno is %x\n", bus->busno);
debug ("sec_number is %x\n", sec_number);
if (!bus) {
err ("cannot find Bus structure for the bridged device\n");
return -EINVAL;
}
debug("bus->busno is %x\n", bus->busno);
debug("sec_number is %x\n", sec_number);

ibmphp_remove_bus (bus, busno);

Expand Down

0 comments on commit b0d974e

Please sign in to comment.