Skip to content

Commit

Permalink
PCIE: cleanup on probe error
Browse files Browse the repository at this point in the history
If pcie_portdrv_probe() fails but it had already called
pci_enable_device(), then call pci_disable_device() when
returning error.

Is there some reason that this isn't being done?
or was it just missed?

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Randy Dunlap authored and Greg Kroah-Hartman committed Aug 3, 2006
1 parent 6085483 commit e4fd1f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pci/pcie/portdrv_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
"%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n",
__FUNCTION__, dev->device, dev->vendor);
}
if (pcie_port_device_register(dev))
if (pcie_port_device_register(dev)) {
pci_disable_device(dev);
return -ENOMEM;
}

return 0;
}
Expand Down

0 comments on commit e4fd1f4

Please sign in to comment.