1. 27 7月, 2010 12 次提交
    • F
      ath9k: fix yet another buffer leak in the tx aggregation code · 4cee7861
      Felix Fietkau 提交于
      When an aggregation session is being cleaned up, while the tx status
      for some frames is being processed, the TID is flushed and its buffers
      are sent out.
      
      Unfortunately that left the pending un-acked frames unprocessed, thus
      leaking buffers. Fix this by reordering the code so that those frames
      are processed first, before the TID is flushed.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Cc: stable@kernel.org
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4cee7861
    • D
      libertas: precedence bug · bd75eb85
      Dan Carpenter 提交于
      Negate has precedence over comparison so the original test was always
      false.  (Neither 0 nor 1 are equal to NL80211_IFTYPE_MONITOR).
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Acked-by: NDan Williams <dcbw@redhat.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      bd75eb85
    • V
      ath9k: Fix inconsistency between txq->stopped and the actual queue state · 68e8f2fa
      Vasanthakumar Thiagarajan 提交于
      Sometimes txq state(txq->stopped) can be marked as started but the actual
      queue may not be started (in ATH_WIPHY_SCAN state, for example). Fix this.
      Signed-off-by: NVasanthakumar Thiagarajan <vasanth@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      68e8f2fa
    • D
      ath5k: snprintf() returns largish values · 2189d13f
      Dan Carpenter 提交于
      snprintf() returns the number of characters that would have been written
      (not counting the NUL character).  So we can't use it as the limiter to
      simple_read_from_buffer() without capping it first at sizeof(buf).
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      2189d13f
    • D
      ath9k: snprintf() returns largish values · 9746010b
      Dan Carpenter 提交于
      The snprintf() function returns the number of characters that would have
      been written (not counting the NUL character on the end).  It could
      potentially be larger than the size of the buffer.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      9746010b
    • J
      drivers/net/wireless/wl12xx: Use kmemdup · 929ebd30
      Julia Lawall 提交于
      Use kmemdup when some other buffer is immediately copied into the
      allocated region.
      
      A simplified version of the semantic patch that makes this change is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression from,to,size,flag;
      statement S;
      @@
      
      -  to = \(kmalloc\|kzalloc\)(size,flag);
      +  to = kmemdup(from,size,flag);
         if (to==NULL || ...) S
      -  memcpy(to, from, size);
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      929ebd30
    • J
      3289a836
    • J
      iwlwifi: assume vif is NULL for internal scans and non-NULL otherwise · a6e492b9
      John W. Linville 提交于
      The current practice of checking vif for NULL in one place but not
      another seems to confuse some static checkers, smatch in particular.
      Since vif will only be NULL in the case of internal scans, adjust the
      checks accordingly.
      Reported-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a6e492b9
    • J
      rtl8180: silence "dubious: x | !y" sparse warning · 28eb3e5a
      John W. Linville 提交于
        CHECK   drivers/net/wireless/rtl818x/rtl8180_rtl8225.c
      drivers/net/wireless/rtl818x/rtl8180_rtl8225.c:53:33: warning: dubious: x | !y
      
      The existing code is clever and works fine, but it's not worth even a
      single line of Sparse warning SPAM...
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      28eb3e5a
    • J
      rtl8180: improve signal reporting for actual rtl8180 hardware · 8b73fb8e
      John W. Linville 提交于
      Adapted from Realtek-provided driver...
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      Tested-by: NPauli Nieminen <suokkos@gmail.com>
      8b73fb8e
    • J
      wl1251: fix sparse-generated warnings · 1ab36d68
      John W. Linville 提交于
        CHECK   drivers/net/wireless/wl12xx/wl1251_tx.c
      drivers/net/wireless/wl12xx/wl1251_tx.c:118:32: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/wl12xx/wl1251_tx.c:118:32:    expected unsigned short [unsigned] [usertype] frag_threshold
      drivers/net/wireless/wl12xx/wl1251_tx.c:118:32:    got restricted __le16 [usertype] <noident>
      drivers/net/wireless/wl12xx/wl1251_tx.c:164:24: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/wl12xx/wl1251_tx.c:164:24:    expected unsigned short [unsigned] [usertype] length
      drivers/net/wireless/wl12xx/wl1251_tx.c:164:24:    got restricted __le16 [usertype] <noident>
      drivers/net/wireless/wl12xx/wl1251_tx.c:166:22: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/wl12xx/wl1251_tx.c:166:22:    expected unsigned short [unsigned] [usertype] rate
      drivers/net/wireless/wl12xx/wl1251_tx.c:166:22:    got restricted __le16 [usertype] <noident>
      drivers/net/wireless/wl12xx/wl1251_tx.c:167:29: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/wl12xx/wl1251_tx.c:167:29:    expected unsigned int [unsigned] [usertype] expiry_time
      drivers/net/wireless/wl12xx/wl1251_tx.c:167:29:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/wl12xx/wl1251_tx.c:200:43: warning: incorrect type in argument 1 (different base types)
      drivers/net/wireless/wl12xx/wl1251_tx.c:200:43:    expected restricted __le16 [usertype] fc
      drivers/net/wireless/wl12xx/wl1251_tx.c:200:43:    got unsigned short [unsigned] [assigned] [usertype] fc
        CHECK   drivers/net/wireless/wl12xx/wl1251_cmd.c
      drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39:    expected unsigned int [unsigned] [usertype] rx_config_options
      drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39:    expected unsigned int [unsigned] [usertype] rx_filter_options
      drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29:    expected unsigned short [unsigned] [usertype] tx_rate
      drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29:    got restricted __le16 [usertype] <noident>
      drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47:    expected unsigned int [unsigned] [usertype] min_duration
      drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47:    expected unsigned int [unsigned] [usertype] max_duration
      drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47:    got restricted __le32 [usertype] <noident>
        CHECK   drivers/net/wireless/wl12xx/wl1251_boot.c
      drivers/net/wireless/wl12xx/wl1251_boot.c:228:22: warning: symbol 'interrupt' shadows an earlier one
      /home/linville/git/wireless-next-2.6/arch/x86/include/asm/hw_irq.h:132:13: originally declared here
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1ab36d68
    • J
      iwlagn: use __packed on new structure definitions · da22f795
      John W. Linville 提交于
      "iwlagn: add statistic notification structure for WiFi/BT devices" added
      several new '__attribute__ ((packed))' lines.  Change them to the
      generic __packed.
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      da22f795
  2. 23 7月, 2010 10 次提交
  3. 22 7月, 2010 2 次提交
    • L
      b43: silence phy_n sparse warnings · acd82aa8
      Larry Finger 提交于
      drivers/net/wireless/b43/phy_n.c:512:53: warning: cast truncates bits from constant value (ffff0fff becomes fff)
      drivers/net/wireless/b43/phy_n.c:765:66: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
      drivers/net/wireless/b43/phy_n.c:1012:38: warning: cast truncates bits from constant value (ffff00ff becomes ff)
      drivers/net/wireless/b43/phy_n.c:1119:38: warning: cast truncates bits from constant value (ffff0fff becomes fff)
      drivers/net/wireless/b43/phy_n.c:2458:56: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
      drivers/net/wireless/b43/phy_n.c:2933:38: warning: cast truncates bits from constant value (ffff0fff becomes fff)
      drivers/net/wireless/b43/phy_n.c:3294:57: warning: cast truncates bits from constant value (ffff3fff becomes 3fff)
      Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      acd82aa8
    • J
      b43: silence most sparse warnings · 41950bdf
      John W. Linville 提交于
        CHECK   drivers/net/wireless/b43/main.c
      drivers/net/wireless/b43/main.c:111:5: warning: symbol 'b43_modparam_pio' was not declared. Should it be static?
        CHECK   drivers/net/wireless/b43/phy_g.c
      drivers/net/wireless/b43/phy_g.c:975:56: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
        CHECK   drivers/net/wireless/b43/phy_lp.c
      drivers/net/wireless/b43/phy_lp.c:2701:6: warning: symbol 'b43_lpphy_op_switch_analog' was not declared. Should it be static?
      drivers/net/wireless/b43/phy_lp.c:1148:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
      drivers/net/wireless/b43/phy_lp.c:1525:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
      drivers/net/wireless/b43/phy_lp.c:1529:30: warning: cast truncates bits from constant value (ffff1fff becomes 1fff)
        CHECK   drivers/net/wireless/b43/wa.c
      drivers/net/wireless/b43/wa.c:385:60: warning: cast truncates bits from constant value (ffff00ff becomes ff)
      drivers/net/wireless/b43/wa.c:403:55: warning: cast truncates bits from constant value (ffff00ff becomes ff)
      drivers/net/wireless/b43/wa.c:405:55: warning: cast truncates bits from constant value (ffff00ff becomes ff)
      drivers/net/wireless/b43/wa.c:415:71: warning: cast truncates bits from constant value (ffff0fff becomes fff)
      
      AFAICT, none of these amount to real bugs.  But this reduces warning
      spam from sparse w/o significantly affecting readability of the code (IMHO).
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      41950bdf
  4. 21 7月, 2010 7 次提交
    • J
      rtl8180: improve signal reporting for rtl8185 hardware · 8b74964c
      John W. Linville 提交于
      The existing code seemed to be somewhat based on the datasheet, but
      varied substantially from the vendor-provided driver.  This mirrors the
      handling of the rtl8185 case from that driver, but still neglects the
      specifics for the rtl8180 hardware.  Those details are a bit muddled...
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8b74964c
    • J
      mwl8k: correct/silence sparse warnings · b603742f
      John W. Linville 提交于
      drivers/net/wireless/mwl8k.c:1541:21: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/mwl8k.c:1541:21:    expected restricted __le16 [usertype] result
      drivers/net/wireless/mwl8k.c:1541:21:    got int
      drivers/net/wireless/mwl8k.c:1575:42:    expected unsigned short [unsigned] [usertype] cmd
      drivers/net/wireless/mwl8k.c:1575:42:    got restricted __le16 [usertype] code
      drivers/net/wireless/mwl8k.c:1587:50: warning: incorrect type in argument 1 (different base types)
      drivers/net/wireless/mwl8k.c:1587:50:    expected unsigned short [unsigned] [usertype] cmd
      drivers/net/wireless/mwl8k.c:1587:50:    got restricted __le16 [usertype] code
      drivers/net/wireless/mwl8k.c:1592:50: warning: incorrect type in argument 1 (different base types)
      drivers/net/wireless/mwl8k.c:1592:50:    expected unsigned short [unsigned] [usertype] cmd
      drivers/net/wireless/mwl8k.c:1592:50:    got restricted __le16 [usertype] code
      drivers/net/wireless/mwl8k.c:1845:27: warning: incorrect type in argument 1 (different base types)
      drivers/net/wireless/mwl8k.c:1845:27:    expected unsigned int [unsigned] [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1845:27:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1848:27: warning: incorrect type in argument 1 (different base types)
      drivers/net/wireless/mwl8k.c:1848:27:    expected unsigned int [unsigned] [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1848:27:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1851:27: warning: incorrect type in argument 1 (different base types)
      drivers/net/wireless/mwl8k.c:1851:27:    expected unsigned int [unsigned] [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1851:27:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1854:27: warning: incorrect type in argument 1 (different base types)
      drivers/net/wireless/mwl8k.c:1854:27:    expected unsigned int [unsigned] [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1854:27:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1857:27: warning: incorrect type in argument 1 (different base types)
      drivers/net/wireless/mwl8k.c:1857:27:    expected unsigned int [unsigned] [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1857:27:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1860:27: warning: incorrect type in argument 1 (different base types)
      drivers/net/wireless/mwl8k.c:1860:27:    expected unsigned int [unsigned] [usertype] <noident>
      drivers/net/wireless/mwl8k.c:1860:27:    got restricted __le32 [usertype] <noident>
      drivers/net/wireless/mwl8k.c:3055:20: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/mwl8k.c:3055:20:    expected restricted __le16 [usertype] ht_caps
      drivers/net/wireless/mwl8k.c:3055:20:    got unsigned short [unsigned] [usertype] cap
      
      At least the last one looks like a real bug...
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      Acked-by: NLennert Buytenhek <buytenh@wantstofly.org>
      b603742f
    • J
      rt2x00: correct sparse warning in rt2x00debug.c · 16124541
      John W. Linville 提交于
        CHECK   drivers/net/wireless/rt2x00/rt2x00debug.c
      drivers/net/wireless/rt2x00/rt2x00debug.c:193:28: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/rt2x00/rt2x00debug.c:193:28:    expected restricted __le32 [usertype] chip_rev
      drivers/net/wireless/rt2x00/rt2x00debug.c:193:28:    got restricted __le16 [usertype] <noident>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      16124541
    • J
      libipw: correct sparse warnings and mark some variables static · cc40cc56
      John W. Linville 提交于
        CHECK   drivers/net/wireless/ipw2x00/libipw_module.c
      drivers/net/wireless/ipw2x00/libipw_module.c:65:21: warning: symbol 'libipw_config_ops' was not declared. Should it be static?
      drivers/net/wireless/ipw2x00/libipw_module.c:66:6: warning: symbol 'libipw_wiphy_privid' was not declared. Should it be static?
        CHECK   drivers/net/wireless/ipw2x00/libipw_wx.c
      drivers/net/wireless/ipw2x00/libipw_wx.c:415:17: warning: symbol 'ssid' shadows an earlier one
      drivers/net/wireless/ipw2x00/libipw_wx.c:324:9: originally declared here
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      cc40cc56
    • J
      ipw2100: mark ipw2100_pm_qos_req static · d267be30
      John W. Linville 提交于
        CHECK   drivers/net/wireless/ipw2x00/ipw2100.c
      drivers/net/wireless/ipw2x00/ipw2100.c:177:28: warning: symbol 'ipw2100_pm_qos_req' was not declared. Should it be static?
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d267be30
    • J
      ath9k: correct sparse identified endian bug in ath_paprd_calibrate · a3d3da14
      John W. Linville 提交于
      drivers/net/wireless/ath/ath9k/main.c:282:26: warning: incorrect type in assignment (different base types)
      drivers/net/wireless/ath/ath9k/main.c:282:26:    expected restricted __le16 [usertype] duration_id
      drivers/net/wireless/ath/ath9k/main.c:282:26:    got int
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a3d3da14
    • J
      mac80211: move QoS-enable to BSS info · 4ced3f74
      Johannes Berg 提交于
      Ever since
      
      commit e1b3ec1a
      Author: Stanislaw Gruszka <sgruszka@redhat.com>
      Date:   Mon Mar 29 12:18:34 2010 +0200
      
          mac80211: explicitly disable/enable QoS
      
      mac80211 is telling drivers, in particular
      iwlwifi, whether QoS is enabled or not.
      
      However, this is only relevant for station mode,
      since only then will any device send nullfunc
      frames and need to know whether they should be
      QoS frames or not. In other modes, there are
      (currently) no frames the device is supposed to
      send.
      
      When you now consider virtual interfaces, it
      becomes apparent that the current mechanism is
      inadequate since it enables/disables QoS on a
      global scale, where for nullfunc frames it has
      to be on a per-interface scale.
      
      Due to the above considerations, we can change
      the way mac80211 advertises the QoS state to
      drivers to only ever advertise it as "off" in
      station mode, and make it a per-BSS setting.
      Tested-by: NStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4ced3f74
  5. 17 7月, 2010 6 次提交
  6. 15 7月, 2010 3 次提交