linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* brcm: list of smatch warnings
@ 2011-12-15 11:29 Dan Carpenter
  2011-12-15 11:40 ` Arend van Spriel
  2011-12-21 17:47 ` Arend van Spriel
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2011-12-15 11:29 UTC (permalink / raw)
  To: Franky (Zhenhui) Lin; +Cc: linux-wireless

Smatch still complains about the brcm driver.  Could you take a look at
these messages?  It's mostly just cleanups like doing the correct cast
for min_t() or handling the default cases on switch statements etc or
verifying that we broke out of a loop instead of coming to the end
without finding what we were looking for.

regards,
dan carpenter

drivers/net/wireless/brcm80211/brcmsmac/main.c +2902 brcms_b_read_objmem(11) info: ignoring unreachable code.
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +1146 brcms_suspend(8) error: we previously assumed 'wl' could be null (see line 1145)
drivers/net/wireless/brcm80211/brcmsmac/srom.c +641 _initvars_srom_pci(16) error: potential null dereference 'entry'.  (kzalloc returns null)
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +19651 wlc_phy_init_nphy(209) error: potential null derefence 'tx_pwrctrl_tbl'.
	To hit this we need !PHY_IPA(pi), NREV_GE(pi->pubpi.phy_rev, 7),
	pi->pubpi.radiorev != 5 and pi->pubpi.radiorev != 3.  I don't
	know if that's possible.
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +20544 wlc_phy_chan2freq_nphy(72) error: potential null derefence 'chan_info_tbl_p_2'.
	To hit this pi->pubpi.radiover != 0x0 and pi->pubpi.radiover != 0x1.
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +20560 wlc_phy_chan2freq_nphy(88) error: potential null derefence 'chan_info_tbl_p_0'.
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +20610 wlc_phy_chan2freq_nphy(138) error: potential null derefence 'chan_info_tbl_p_1'.
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +20833 wlc_phy_chanspec_radio2056_setup(112) error: potential null derefence 'regs_SYN_2056_ptr'.
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +23657 wlc_phy_iqcal_gainparams_nphy(47) error: buffer overflow 'tbl_iqcal_gainparams_nphy[band_idx]' 9 <= 9
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +27498 wlc_phy_rc_sweep_nphy(179) warn: assigning -8 to unsigned variable 'rccal_val'
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +28273 wlc_phy_txpwr_apply_nphy(124) error: potential null derefence 'pwr_offsets2'.
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +28328 wlc_phy_txpwr_apply_nphy(179) error: potential null derefence 'tx_srom_max_rate'.
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +1710 wlc_phy_txpower_reg_limit_calc(50) error: potential null derefence 'txpwr_ptr1'.
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +1719 wlc_phy_txpower_reg_limit_calc(59) error: potential null derefence 'txpwr_ptr2'.
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +1377 brcmf_cfg80211_connect(65) warn: min_t truncates here '(sme->ssid_len)' (4294967295 vs 9223372036854775807)
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +1275 brcmf_sdbrcm_rxglom(156) warn: min_t truncates here '(pfirst->len)' (2147483647 vs 4294967295)
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +1457 brcmf_sdbrcm_rxglom(338) warn: min_t truncates here '(pfirst->len)' (2147483647 vs 4294967295)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +300 brcmf_sdioh_request_buffer(10) warn: variable dereferenced before check 'pkt' (see line 295)


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

* Re: brcm: list of smatch warnings
  2011-12-15 11:29 brcm: list of smatch warnings Dan Carpenter
@ 2011-12-15 11:40 ` Arend van Spriel
  2011-12-21 17:47 ` Arend van Spriel
  1 sibling, 0 replies; 4+ messages in thread
From: Arend van Spriel @ 2011-12-15 11:40 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Franky (Zhenhui) Lin, linux-wireless@vger.kernel.org

On 12/15/2011 12:29 PM, Dan Carpenter wrote:
> Smatch still complains about the brcm driver.  Could you take a look at
> these messages?  It's mostly just cleanups like doing the correct cast
> for min_t() or handling the default cases on switch statements etc or
> verifying that we broke out of a loop instead of coming to the end
> without finding what we were looking for.
> 
> regards,
> dan carpenter
> 

Thanks, Dan

Will sure take a look at those messages. It is on our internal worklist.

Gr. AvS


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

* Re: brcm: list of smatch warnings
  2011-12-15 11:29 brcm: list of smatch warnings Dan Carpenter
  2011-12-15 11:40 ` Arend van Spriel
@ 2011-12-21 17:47 ` Arend van Spriel
  2011-12-21 18:19   ` Dan Carpenter
  1 sibling, 1 reply; 4+ messages in thread
From: Arend van Spriel @ 2011-12-21 17:47 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Franky (Zhenhui) Lin, linux-wireless@vger.kernel.org

On 12/15/2011 12:29 PM, Dan Carpenter wrote:
> Smatch still complains about the brcm driver.  Could you take a look at
> these messages?  It's mostly just cleanups like doing the correct cast
> for min_t() or handling the default cases on switch statements etc or
> verifying that we broke out of a loop instead of coming to the end
> without finding what we were looking for.

As promised I took a look at the smatch complaints.

> drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +1710 wlc_phy_txpower_reg_limit_calc(50) error: potential null derefence 'txpwr_ptr1'.
> drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +1719 wlc_phy_txpower_reg_limit_calc(59) error: potential null derefence 'txpwr_ptr2'.

However, I am not sure about these two. Reading the code these seem
false positives. Could you confirm or correct me on these.

Gr. AvS


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

* Re: brcm: list of smatch warnings
  2011-12-21 17:47 ` Arend van Spriel
@ 2011-12-21 18:19   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2011-12-21 18:19 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: Franky (Zhenhui) Lin, linux-wireless@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]

On Wed, Dec 21, 2011 at 06:47:13PM +0100, Arend van Spriel wrote:
> On 12/15/2011 12:29 PM, Dan Carpenter wrote:
> > Smatch still complains about the brcm driver.  Could you take a look at
> > these messages?  It's mostly just cleanups like doing the correct cast
> > for min_t() or handling the default cases on switch statements etc or
> > verifying that we broke out of a loop instead of coming to the end
> > without finding what we were looking for.
> 
> As promised I took a look at the smatch complaints.
> 
> > drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +1710 wlc_phy_txpower_reg_limit_calc(50) error: potential null derefence 'txpwr_ptr1'.
> > drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +1719 wlc_phy_txpower_reg_limit_calc(59) error: potential null derefence 'txpwr_ptr2'.
> 
> However, I am not sure about these two. Reading the code these seem
> false positives. Could you confirm or correct me on these.

Yes.  You're obviously right.

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2011-12-21 18:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15 11:29 brcm: list of smatch warnings Dan Carpenter
2011-12-15 11:40 ` Arend van Spriel
2011-12-21 17:47 ` Arend van Spriel
2011-12-21 18:19   ` Dan Carpenter

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