rtlwifi: Return correct failure code on error
authorSimon Graham <simon.graham@virtualcomputer.com>
Wed, 8 Feb 2012 17:34:23 +0000 (12:34 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 8 Feb 2012 21:07:24 +0000 (16:07 -0500)
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 is set to zero.

Signed-off-by: Simon Graham <simon.graham@virtualcomputer.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/pci.c

index c503bd3b809ea3cfff561c4de3b3b73db66bef76..8a941b588a4193cbd3ea28915b2d062dc9ccf74f 100644 (file)
@@ -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;