Skip to contentSkip to conversation

iwlwifi: Return correct failure code on error

PATCH Superseded Simon Graham 2 participants 2 messages Feb 8, 2012 Networking drivers (wireless)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iwlwifi: Return correct failure code on error

Callers of rtl_pci_init expect zero to be returned on error. Returning the error code leads to, amongst other things, divide by zero panics attempting to use the ring size that was never set.

---
 drivers/net/wireless/rtlwifi/pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rtlwifi/pci.c +1 -1
index fb84707..f0ce366 100644
@@ -1492,7 +1492,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
 	if (err) {
 		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
 			 "tx ring initialization failed\n");
-		return err;
+		return 0;
 	}
 
 	return 1;
Signature · 1 line
1.7.8.3
#1 lore raw
Quoted 3 lines · Simon Graham

Callers of rtl_pci_init expect zero to be returned on error. Returning the error code leads to, amongst other things, divide by zero panics attempting to use the ring size that was never set.

You probably want to resent with the subject:

[PATCH] rtlwifi: return correct failure code on error

instead of 'iwlwifi' which is the Intel wifi driver.

Dan

Quoted 17 lines
---
 drivers/net/wireless/rtlwifi/pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rtlwifi/pci.c +1 -1
index fb84707..f0ce366 100644
@@ -1492,7 +1492,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
 	if (err) {
 		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
 			 "tx ring initialization failed\n");
-		return err;
+		return 0;
 	}
 
 	return 1;