Skip to contentSkip to conversation

rtlwifi: Modify rtl_pci_init to return 0 on success

PATCH In review Simon Graham 2 participants 2 messages Feb 9, 2012 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 rtlwifi: Modify rtl_pci_init to return 0 on success

Fixes problem where caller would think routine succeeded when it failed leading to divide by zero panic.

---
 drivers/net/wireless/rtlwifi/pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rtlwifi/pci.c +2 -2
index fb84707..16ec0c1 100644
@@ -1495,7 +1495,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
 		return err;
 	}
 
-	return 1;
+	return 0;
 }
 
 static int rtl_pci_start(struct ieee80211_hw *hw)
@@ -1866,7 +1866,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
 	}
 
 	/* Init PCI sw */
-	err = !rtl_pci_init(hw, pdev);
+	err = rtl_pci_init(hw, pdev);
 	if (err) {
 		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n");
 		goto fail3;
Signature · 1 line
1.7.9
Acked-by on v3 1/1
#1 lore raw
Quoted 5 lines · Simon Graham

Fixes problem where caller would think routine succeeded when it failed leading to divide by zero panic.

---

Simon: Congratulations - your mailer mangling problem seems to be fixed.

John: This is V3.3 and stable material. This bug goes back to at least 2.6.39.

Larry

Quoted 25 lines
  drivers/net/wireless/rtlwifi/pci.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rtlwifi/pci.c +2 -2
index fb84707..16ec0c1 100644
@@ -1495,7 +1495,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
  		return err;
  	}
 
-	return 1;
+	return 0;
  }
 
  static int rtl_pci_start(struct ieee80211_hw *hw)
@@ -1866,7 +1866,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
  	}
 
  	/* Init PCI sw */
-	err = !rtl_pci_init(hw, pdev);
+	err = rtl_pci_init(hw, pdev);
  	if (err) {
  		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n");
  		goto fail3;