linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: net: wireless: add brcm80211 drivers
@ 2012-08-05 19:57 Dan Carpenter
  2012-08-06  8:50 ` Arend van Spriel
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2012-08-05 19:57 UTC (permalink / raw)
  To: arend; +Cc: linux-wireless

Hi Arend,

The patch 5b435de0d786: "net: wireless: add brcm80211 drivers" from
Oct 5, 2011, leads to the following warning:
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c:1699 brcmf_sdbrcm_readframes()
	 warn: is it ok to set 'rxseq' to -1?

  1697                          cnt = brcmf_sdbrcm_rxglom(bus, rxseq);
  1698                          brcmf_dbg(GLOM, "rxglom returned %d\n", cnt);
  1699                          rxseq += cnt - 1;
  1700                          rxleft = (rxleft > cnt) ? (rxleft - cnt) : 1;
  1701                          continue;

This isn't a warning, it's just one of the things I audit.
brcmf_sdbrcm_rxglom() can return 0 so it's weird that we do
"rxseq += 0 - 1;"  Was that intended?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread
* re: net: wireless: add brcm80211 drivers
@ 2016-06-27 13:22 Dan Carpenter
  2016-06-27 19:12 ` Dan Carpenter
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2016-06-27 13:22 UTC (permalink / raw)
  To: arend; +Cc: linux-wireless, brcm80211-dev-list.pdl

Hello Arend van Spriel,

The patch 5b435de0d786: "net: wireless: add brcm80211 drivers" from
Oct 5, 2011, leads to the following static checker warning:

	drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c:26460 wlc_phy_rxcal_radio_setup_nphy()
	warn: mask and shift to zero

drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
 26452                                  } else {
 26453                                          pi->tx_rx_cal_radio_saveregs[4] =
 26454                                                  read_radio_reg(pi,
 26455                                                          RADIO_2056_RX_LNAA_TUNE
 26456                                                          | RADIO_2056_RX0);
 26457  
 26458                                          offtune_val =
 26459                                                  (pi->tx_rx_cal_radio_saveregs
 26460                                                   [2] & 0xF0) >> 8;

This is obviously nonsense code, but I have no idea what was intended.

 26461                                          offtune_val =
 26462                                                  (offtune_val <= 0x7) ? 0xF : 0;

This is perhaps a bug fix/work around for the earlier line.

 26463  
 26464                                          mod_radio_reg(pi,
 26465                                                        RADIO_2056_RX_LNAA_TUNE |
 26466                                                        RADIO_2056_RX0, 0xF0,
 26467                                                        (offtune_val << 8));
 26468                                  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 10+ messages in thread
* re: net: wireless: add brcm80211 drivers
@ 2012-05-13 17:43 Dan Carpenter
  2012-05-14  7:07 ` Arend van Spriel
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2012-05-13 17:43 UTC (permalink / raw)
  To: arend; +Cc: linux-wireless

Hi Arend,

This code is not really new, but I thought I would email you anyway
because I know you are responsive.  :)

The patch 5b435de0d786: "net: wireless: add brcm80211 drivers" from 
Oct 5, 2011, leads to the following Smatch complaint:

drivers/net/wireless/brcm80211/brcmsmac/ampdu.c:741 brcms_c_sendampdu()
	 warn: variable dereferenced before check 'p' (see line 739)

drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
   733                  /*
   734                   * check to see if the next pkt is
   735                   * a candidate for aggregation
   736                   */
   737                  p = pktq_ppeek(&qi->q, prec);
   738			/* tx_info must be checked with current p */
   739			tx_info = IEEE80211_SKB_CB(p);
                                  ^^^^^^^^^^^^^^^^
"p" is dereferenced inside the call to IEEE80211_SKB_CB().

   740	
   741			if (p) {
                           ^^^
Checked too late.

   742				if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) &&
   743				    ((u8) (p->priority) == tid)) {

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-06-27 19:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-05 19:57 net: wireless: add brcm80211 drivers Dan Carpenter
2012-08-06  8:50 ` Arend van Spriel
  -- strict thread matches above, loose matches on Subject: below --
2016-06-27 13:22 Dan Carpenter
2016-06-27 19:12 ` Dan Carpenter
2012-05-13 17:43 Dan Carpenter
2012-05-14  7:07 ` Arend van Spriel
2012-05-14  8:34   ` Dan Carpenter
2012-05-14  9:06     ` Arend van Spriel
2012-05-14  9:28       ` Dan Carpenter
2012-05-14 11:45     ` Julia Lawall

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).