Skip to content

Commit

Permalink
rtlwifi: Modify rtl_pci_init to return 0 on success
Browse files Browse the repository at this point in the history
Fixes problem where caller would think routine succeeded when it failed
leading to divide by zero panic.

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>
  • Loading branch information
Simon Graham authored and John W. Linville committed Feb 9, 2012
1 parent b57e6b5 commit c27111e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/rtlwifi/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
return err;
}

return 1;
return 0;
}

static int rtl_pci_start(struct ieee80211_hw *hw)
Expand Down Expand Up @@ -1870,7 +1870,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
}

/* Init PCI sw */
err = !rtl_pci_init(hw, pdev);
err = rtl_pci_init(hw, pdev);
if (err) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
("Failed to init PCI.\n"));
Expand Down

0 comments on commit c27111e

Please sign in to comment.