linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: Return correct failure code on error
@ 2012-02-08 21:05 Simon Graham
  2012-02-08 21:09 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Graham @ 2012-02-08 21:05 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, Larry.Finger, chaoming_li

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 was never set.

---
 drivers/net/wireless/rtlwifi/pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index fb84707..f0ce366 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;
-- 
1.7.8.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iwlwifi: Return correct failure code on error
  2012-02-08 21:05 [PATCH] iwlwifi: Return correct failure code on error Simon Graham
@ 2012-02-08 21:09 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2012-02-08 21:09 UTC (permalink / raw)
  To: Simon Graham; +Cc: linux-wireless, linville, Larry.Finger, chaoming_li

On Wed, 2012-02-08 at 16:05 -0500, Simon Graham wrote:
> 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 was never set.

You probably want to resent with the subject:

[PATCH] rtlwifi: return correct failure code on error

instead of 'iwlwifi' which is the Intel wifi driver.

Dan

> ---
>  drivers/net/wireless/rtlwifi/pci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
> index fb84707..f0ce366 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;



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-08 21:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-08 21:05 [PATCH] iwlwifi: Return correct failure code on error Simon Graham
2012-02-08 21:09 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).