All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Arik Nemtsov <arik@wizery.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org
Subject: re: wl12xx: support up to 8 stations in AP-mode
Date: Wed, 21 Sep 2011 10:25:00 +0300	[thread overview]
Message-ID: <1316589900.2157.392.camel@cumari> (raw)
In-Reply-To: <20110921070525.GD4999@elgon.mountain>

On Wed, 2011-09-21 at 00:05 -0700, Dan Carpenter wrote: 
> Hi Arik,
> 
> Smatch complains about c47e8229fa56 "wl12xx: support up to 8 stations
> in AP-mode"
> 
> drivers/net/wireless/wl12xx/main.c +832 wl12xx_irq_update_links_status(22)
> 	error: buffer overflow 'status->tx_lnk_free_pkts' 8 <= 10
> 
>    828          for (hlid = WL1271_AP_STA_HLID_START; hlid < AP_MAX_LINKS; hlid++) {
>                                                              ^^^^^^^^^^^^
> We increased this to 11.
> 
>    829                  if (!wl1271_is_active_sta(wl, hlid))
>    830                          continue;
>    831  
>    832                  cnt = status->tx_lnk_free_pkts[hlid] -
>                                       ^^^^^^^^^^^^^^^^^^^^^^
> 
> But the ->tx_lnk_free_pkts[] array still only has 8 elements so we're
> reading past the end of the array.
> 
>    833                        wl->links[hlid].prev_freed_pkts;
>    834  
>    835                  wl->links[hlid].prev_freed_pkts =
>    836                          status->tx_lnk_free_pkts[hlid];
>    837                  wl->links[hlid].allocated_pkts -= cnt;
>    838  
>    839                  wl12xx_irq_ps_regulate_link(wl, hlid,
>    840                                              wl->links[hlid].allocated_pkts);
>    841          }

Good catch, Dan! Thanks for checking this.

I checked our new firmware API and it seems that the wl12xx_fw_status
structure has changed.  Now, WL12XX_MAX_LINKS, should be 12 instead of
8.

Arik, can you verify this and send a fix patch?


-- 
Cheers,
Luca.


  reply	other threads:[~2011-09-21  7:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21  7:05 wl12xx: support up to 8 stations in AP-mode Dan Carpenter
2011-09-21  7:25 ` Luciano Coelho [this message]
2011-09-22  5:29   ` Arik Nemtsov

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=1316589900.2157.392.camel@cumari \
    --to=coelho@ti.com \
    --cc=arik@wizery.com \
    --cc=dan.carpenter@oracle.com \
    --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 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.