linux/drivers/net/wireless
Christian Lamparter 1981e881fd carl9170: explain why sta cannot be NULL for ampdus
Dan Carpenter reported that smatch detected a potential
problem with the code [1]:
 drivers/net/wireless/ath/carl9170/tx.c:1488 carl9170_op_tx()
  error: we previously assumed 'sta' could be null (see line 1482)

 drivers/net/wireless/ath/carl9170/tx.c
  1482  if (sta) {
           ^^^^^ New check.
  [...]
  1485  }
  1487  if (info->flags & IEEE80211_TX_CTL_AMPDU) {
  1488    run = carl9170_tx_ampdu_queue(ar, sta, skb);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   Old dereference of "sta" inside the call to carl9170_tx_ampdu_queue().

A range of solutions have been discussed in [2] and
we agreed on the following: "
> we might as well add a comment to carl9170_tx_ampdu_queue
> and explain the situation [in a way that's obvious to a
> human reader]. This way we can save the "if"... which is
> a small win since carl9170_op_tx is sort of a hot-path.
Putting a comment there is fine. Without the comment
it's easy for a human reader to get confused why the
check is there. So long as humans can read the code,
that's all that matters."

[1] <http://www.spinics.net/lists/linux-wireless/msg94526.html>
[2] <http://www.spinics.net/lists/linux-kernel-janitors/msg14953.html>

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-12-06 14:58:55 -05:00
..
ath carl9170: explain why sta cannot be NULL for ampdus 2012-12-06 14:58:55 -05:00
b43 mac80211: support RX_FLAG_MACTIME_END 2012-11-13 21:43:55 +01:00
b43legacy mac80211: support RX_FLAG_MACTIME_END 2012-11-13 21:43:55 +01:00
brcm80211 brcmfmac: convert struct spinlock to spinlock_t 2012-12-06 14:58:54 -05:00
hostap wireless: drivers: make use of WLAN_EID_VENDOR_SPECIFIC 2012-10-18 09:01:54 +02:00
ipw2x00 net/wireless: ipw2200: introduce ipw_set_geo function 2012-11-21 14:16:02 -05:00
iwlegacy iwlegacy: initialize rx_status 2012-11-26 14:54:20 -05:00
iwlwifi This is an NFC LLCP fix for 3.7 and contains only one patch. 2012-12-06 14:55:57 -05:00
libertas Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2012-12-06 14:58:41 -05:00
libertas_tf mac80211: move TX station pointer and restructure TX 2012-07-31 16:18:39 +02:00
mwifiex Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2012-12-06 14:58:41 -05:00
orinoco cfg80211: pass a channel definition struct 2012-11-26 12:42:58 +01:00
p54 p54: potential signedness issue in p54_parse_rssical() 2012-12-03 13:51:59 -05:00
prism54
rt2x00 rt2x00: rt2800lib: introduce RFCSR3_VCOCAL_EN 2012-12-03 13:52:01 -05:00
rtl818x mac80211: support RX_FLAG_MACTIME_END 2012-11-13 21:43:55 +01:00
rtlwifi rtlwifi: use SIMPLE_DEV_PM_OPS 2012-11-30 14:00:37 -05:00
ti mac80211: remove probe response temporary buffer allocation 2012-11-30 13:41:27 +01:00
zd1211rw Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-10-02 13:38:27 -07:00
adm8211.c mac80211: move TX station pointer and restructure TX 2012-07-31 16:18:39 +02:00
adm8211.h
airo.c wireless: drivers: make use of WLAN_EID_VENDOR_SPECIFIC 2012-10-18 09:01:54 +02:00
airo.h
airo_cs.c
at76c50x-usb.c wireless: Convert dev_printk(KERN_<LEVEL> to dev_<level>( 2012-11-14 14:55:32 -05:00
at76c50x-usb.h
atmel.c
atmel.h
atmel_cs.c
atmel_pci.c
Kconfig iwmc3200wifi: remove driver for unavailable hardware 2012-07-10 12:16:32 -04:00
mac80211_hwsim.c mac80211: remove probe response temporary buffer allocation 2012-11-30 13:41:27 +01:00
mac80211_hwsim.h
Makefile iwmc3200wifi: remove driver for unavailable hardware 2012-07-10 12:16:32 -04:00
mwl8k.c mwl8k: remove useless pci shutdown callback and stray debugging 2012-12-03 13:52:01 -05:00
ray_cs.c
ray_cs.h
rayctl.h
rndis_wlan.c cfg80211: pass a channel definition struct 2012-11-26 12:42:58 +01:00
wl3501.h
wl3501_cs.c wl3501_cs: use is_broadcast_ether_addr() instead of memcmp() 2012-09-07 15:03:40 -04:00
zd1201.c
zd1201.h