diff mbox

rtlwifi: potential forever loop in rtl92de_hw_init()

Message ID 20110629063149.GE14591@shale.localdomain (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Dan Carpenter June 29, 2011, 6:31 a.m. UTC
"i" should be an int here because we are trying to use it to count
to 10000.  The original code looks like it could hang in a forever
loop.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
If we exit the loop via a timeout, that error isn't handled.  Should
we limp along, or return an error?

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Larry Finger June 29, 2011, 1:46 p.m. UTC | #1
On 06/29/2011 01:31 AM, Dan Carpenter wrote:
> "i" should be an int here because we are trying to use it to count
> to 10000.  The original code looks like it could hang in a forever
> loop.
>
> Signed-off-by: Dan Carpenter<error27@gmail.com>
> ---
> If we exit the loop via a timeout, that error isn't handled.  Should
> we limp along, or return an error?

ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>

Dan,

Thanks for this part. After another look at this routine, there are a couple of 
places that need to be fixed. I will take care of that.

Larry

>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> index eedfb38..cbc0f40 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
> @@ -908,7 +908,8 @@ int rtl92de_hw_init(struct ieee80211_hw *hw)
>   	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
>   	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
>   	bool rtstatus = true;
> -	u8 tmp_u1b, i;
> +	u8 tmp_u1b;
> +	int i;
>   	int err;
>   	unsigned long flags;
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
index eedfb38..cbc0f40 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
@@ -908,7 +908,8 @@  int rtl92de_hw_init(struct ieee80211_hw *hw)
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	bool rtstatus = true;
-	u8 tmp_u1b, i;
+	u8 tmp_u1b;
+	int i;
 	int err;
 	unsigned long flags;