diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-02-09 14:48:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-09 14:49:37 -0500 |
commit | 12325280dfeba18164f9c47e226a40ab34e23ee7 (patch) | |
tree | b032bd02daad20faebfe811895e7b270e50a994a | |
parent | 2cfc6fc584a65db87935ca4e4d5e1ad89d5192ee (diff) |
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.
(This also reverts an earlier attempt, commit 42bc0c97 "rtlwifi: Return
correct failure code on error". -- JWL)
Signed-off-by: Simon Graham <simon.graham@virtualcomputer.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 8a941b588a41..07dd38efe62a 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -1492,10 +1492,10 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev) | |||
1492 | if (err) { | 1492 | if (err) { |
1493 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1493 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
1494 | "tx ring initialization failed\n"); | 1494 | "tx ring initialization failed\n"); |
1495 | return 0; | 1495 | return err; |
1496 | } | 1496 | } |
1497 | 1497 | ||
1498 | return 1; | 1498 | return 0; |
1499 | } | 1499 | } |
1500 | 1500 | ||
1501 | static int rtl_pci_start(struct ieee80211_hw *hw) | 1501 | static int rtl_pci_start(struct ieee80211_hw *hw) |
@@ -1866,7 +1866,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1866 | } | 1866 | } |
1867 | 1867 | ||
1868 | /* Init PCI sw */ | 1868 | /* Init PCI sw */ |
1869 | err = !rtl_pci_init(hw, pdev); | 1869 | err = rtl_pci_init(hw, pdev); |
1870 | if (err) { | 1870 | if (err) { |
1871 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n"); | 1871 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n"); |
1872 | goto fail3; | 1872 | goto fail3; |