From patchwork Wed Jun 29 06:31:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 927202 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5T6WtR7014545 for ; Wed, 29 Jun 2011 06:32:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753646Ab1F2Gcw (ORCPT ); Wed, 29 Jun 2011 02:32:52 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:54696 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752651Ab1F2Gcv (ORCPT ); Wed, 29 Jun 2011 02:32:51 -0400 Received: by pvg12 with SMTP id 12so566327pvg.19 for ; Tue, 28 Jun 2011 23:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=Lr8VIL4YYiE4yI7n7WvMDQFAFrdYdZ8Q2Gh6cdopoSg=; b=LS225PUFJ9IBH4l+/iRyf+LfBUyMRQuuvk9tmZqy3XAcIuYSf1FWyU5Wzjg7LMycda JQ4kr8+EcyiXL7/MDX9K5pUa+lVhQUkGlmmkMWyYFqHlDx9AJLt5TAnudaaiSutkvX4M z0p9JPR4oGB53bYkBnUqJBm4dLql9nLXoabpc= Received: by 10.68.50.105 with SMTP id b9mr657921pbo.271.1309329170783; Tue, 28 Jun 2011 23:32:50 -0700 (PDT) Received: from shale.localdomain ([41.139.221.94]) by mx.google.com with ESMTPS id o2sm705460pbj.17.2011.06.28.23.32.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 28 Jun 2011 23:32:50 -0700 (PDT) Date: Wed, 29 Jun 2011 09:31:49 +0300 From: Dan Carpenter To: Larry Finger Cc: Chaoming Li , "John W. Linville" , "open list:RTL8192CE WIRELES..." , kernel-janitors@vger.kernel.org Subject: [patch] rtlwifi: potential forever loop in rtl92de_hw_init() Message-ID: <20110629063149.GE14591@shale.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 29 Jun 2011 06:32:55 +0000 (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 ACKed-by: Larry Finger --- 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 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;