From: Simon Graham Date: Wed, 8 Feb 2012 17:34:23 +0000 (-0500) Subject: rtlwifi: Return correct failure code on error X-Git-Tag: v3.4-rc1~177^2~112^2~277 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42bc0c9716c456a9686fcd4ee5cf115b992b9952;p=platform%2Fkernel%2Flinux-3.10.git rtlwifi: 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 is set to zero. Signed-off-by: Simon Graham Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index c503bd3..8a941b5 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c @@ -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;