Skip to content

Commit

Permalink
rtlwifi: Return correct failure code on error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Simon Graham authored and John W. Linville committed Feb 8, 2012
1 parent 5ad20dd commit 42bc0c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 42bc0c9

Please sign in to comment.