linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Chaoming Li <chaoming_li@realsil.com.cn>,
	"John W. Linville" <linville@tuxdriver.com>,
	"open list:RTL8192CE WIRELES..." <linux-wireless@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: [patch] rtlwifi: potential forever loop in rtl92de_hw_init()
Date: Wed, 29 Jun 2011 09:31:49 +0300	[thread overview]
Message-ID: <20110629063149.GE14591@shale.localdomain> (raw)

"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?

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;
 

             reply	other threads:[~2011-06-29  6:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29  6:31 Dan Carpenter [this message]
2011-06-29 13:46 ` [patch] rtlwifi: potential forever loop in rtl92de_hw_init() Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110629063149.GE14591@shale.localdomain \
    --to=error27@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=chaoming_li@realsil.com.cn \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).