Skip to content

Commit

Permalink
defxx: Fix DEFPA enable error propagation
Browse files Browse the repository at this point in the history
Correctly propagate the error code from `pci_enable_device' if non zero.
Currently a failure of this function is correctly recognized and device
initialization abandoned, however a successful completion code returned.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Maciej W. Rozycki authored and David S. Miller committed Nov 21, 2014
1 parent 37dd925 commit a65da0c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/net/fddi/defxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,13 @@ static int dfx_register(struct device *bdev)
}

/* Enable PCI device. */
if (dfx_bus_pci && pci_enable_device(to_pci_dev(bdev))) {
printk(KERN_ERR "%s: Cannot enable PCI device, aborting\n",
print_name);
goto err_out;
if (dfx_bus_pci) {
err = pci_enable_device(to_pci_dev(bdev));
if (err) {
pr_err("%s: Cannot enable PCI device, aborting\n",
print_name);
goto err_out;
}
}

SET_NETDEV_DEV(dev, bdev);
Expand Down

0 comments on commit a65da0c

Please sign in to comment.