Skip to contentSkip to conversation

Broadcom 4400 resume small fix

PATCH In review Dmitriy Monakhov 2 participants 2 messages Jan 8, 2007 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Broadcom 4400 resume small fix

Return value of 'pci_enable_device' was ignored in b44_resume(). We can't ingore it because it can fail.

-------

drivers/net/b44.c +7 -1
index 5eb2ec6..63de31b 100644
@@ -2315,9 +2315,15 @@ static int b44_resume(struct pci_dev *pd
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct b44 *bp = netdev_priv(dev);
+	int err;
 
 	pci_restore_state(pdev);
-	pci_enable_device(pdev);
+	err = pci_enable_device(pdev);
+	if (err) {
+		dev_err(&pdev->dev, "Cannot enable PCI device, "
+		       "aborting.\n");
+		return err;
+	}
 	pci_set_master(pdev);
 
 	if (!netif_running(dev))
#1 lore raw

Dmitriy Monakhov <[email protected]> :

Quoted 2 lines

Return value of 'pci_enable_device' was ignored in b44_resume(). We can't ingore it because it can fail.

- Please Cc: [email protected], [email protected] and the maintainer of the driver (Gary Zambrano <[email protected]> as per MAINTAINERS file and the log of the driveri).
- the dev_err() message fits completely on a 80 columns line.
- request-irq is not checked a few lines below either.

It would be nice to avoid the free_irq/pci_disable_device dance altogether.

Signature · 1 line
Ueimor