All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: Dan Carpenter <error27@gmail.com>
Cc: "Chatre, Reinette" <reinette.chatre@intel.com>,
	Intel Linux Wireless <ilw@linux.intel.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [patch] iwlwifi: silence buffer overflow warning
Date: Mon, 11 Jan 2010 09:50:41 +0800	[thread overview]
Message-ID: <1263174641.15653.241.camel@debian> (raw)
In-Reply-To: <20100109084147.GB7840@bicker>

On Sat, 2010-01-09 at 16:41 +0800, Dan Carpenter wrote:
> Smatch (and presumably other static checkers) complain that MAX_TID_COUNT is 
> past the end of the array.  In the resulting discussion, Zhu Yi pointed out
> that this value is not used in real life and the assignment was only there to
> silence a gcc warning.
> 
> If there were a bug in the surrounding code and the value were used, the 
> WARN_ON(!qc) would print a warning before the crash.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Zhu Yi <yi.zhu@intel.com>

Thanks,
-yi

> --- orig/drivers/net/wireless/iwlwifi/iwl-4965.c	2010-01-03 11:02:42.000000000 +0300
> +++ devel/drivers/net/wireless/iwlwifi/iwl-4965.c	2010-01-06 00:27:00.000000000 +0300
> @@ -1961,7 +1961,7 @@ static void iwl4965_rx_reply_tx(struct i
>  	struct ieee80211_tx_info *info;
>  	struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
>  	u32  status = le32_to_cpu(tx_resp->u.status);
> -	int tid = MAX_TID_COUNT;
> +	int uninitialized_var(tid);
>  	int sta_id;
>  	int freed;
>  	u8 *qc = NULL;



      reply	other threads:[~2010-01-11  1:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-09  8:41 [patch] iwlwifi: silence buffer overflow warning Dan Carpenter
2010-01-11  1:50 ` Zhu Yi [this message]

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=1263174641.15653.241.camel@debian \
    --to=yi.zhu@intel.com \
    --cc=error27@gmail.com \
    --cc=ilw@linux.intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=reinette.chatre@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.