1. 03 Aug, 2009 6 commits
    • Julia Lawall's avatar
      drivers/net/wireless: introduce missing kfree · 9f9857bb
      Julia Lawall authored
      Error handling code following a kzalloc should free the allocated data.
      
      The semantic match that finds the problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      expression E;
      identifier f,f1,l;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      <... when != x
           when != if (...) { <+...x...+> }
      (
      x->f1 = E
      |
       (x->f1 == NULL || ...)
      |
       f(...,x->f1,...)
      )
      ...>
      (
       return \(0\|<+...x...+>\|ptr\);
      |
       return@p2 ...;
      )
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      @@
      
      print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      9f9857bb
    • Julia Lawall's avatar
      drivers/net/wireless/iwlwifi: introduce missing kfree · c37457e6
      Julia Lawall authored
      Move orthogonal error handling code up before a kzalloc, so that it
      doesn't have to free the allocated data.
      
      The semantic match that finds the problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      expression E;
      identifier f,f1,l;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      <... when != x
           when != if (...) { <+...x...+> }
      (
      x->f1 = E
      |
       (x->f1 == NULL || ...)
      |
       f(...,x->f1,...)
      )
      ...>
      (
       return \(0\|<+...x...+>\|ptr\);
      |
       return@p2 ...;
      )
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      @@
      
      print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Acked-by: default avatarZhu Yi <yi.zhu@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      c37457e6
    • Patrick Simmons's avatar
      zd1211rw: fix unaligned access in zd_mac_rx · dbc1eec4
      Patrick Simmons authored
      Fix an unaligned memory access in the zd_mac_rx function of zd1211rw
      that causes problems on SPARC64.
      Signed-off-by: default avatarPatrick Simmons <linuxrocks123@netscape.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      dbc1eec4
    • Luis R. Rodriguez's avatar
      cfg80211: fix regression on beacon world roaming feature · 37184244
      Luis R. Rodriguez authored
      A regression was added through patch a4ed90d6:
      
      "cfg80211: respect API on orig_flags on channel for beacon hint"
      
      We did indeed respect _orig flags but the intention was not clearly
      stated in the commit log. This patch fixes firmware issues picked
      up by iwlwifi when we lift passive scan of beaconing restrictions
      on channels its EEPROM has been configured to always enable.
      
      By doing so though we also disallowed beacon hints on devices
      registering their wiphy with custom world regulatory domains
      enabled, this happens to be currently ath5k, ath9k and ar9170.
      The passive scan and beacon restrictions on those devices would
      never be lifted even if we did find a beacon and the hardware did
      support such enhancements when world roaming.
      
      Since Johannes indicates iwlwifi firmware cannot be changed to
      allow beacon hinting we set up a flag now to specifically allow
      drivers to disable beacon hints for devices which cannot use them.
      
      We enable the flag on iwlwifi to disable beacon hints and by default
      enable it for all other drivers. It should be noted beacon hints lift
      passive scan flags and beacon restrictions when we receive a beacon from
      an AP on any 5 GHz non-DFS channels, and channels 12-14 on the 2.4 GHz
      band. We don't bother with channels 1-11 as those channels are allowed
      world wide.
      
      This should fix world roaming for ath5k, ath9k and ar9170, thereby
      improving scan time when we receive the first beacon from any AP,
      and also enabling beaconing operation (AP/IBSS/Mesh) on cards which
      would otherwise not be allowed to do so. Drivers not using custom
      regulatory stuff (wiphy_apply_custom_regulatory()) were not affected
      by this as the orig_flags for the channels would have been cleared
      upon wiphy registration.
      
      I tested this with a world roaming ath5k card.
      
      Cc: Jouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
      Reviewed-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      37184244
    • Johannes Berg's avatar
      cfg80211: add two missing NULL pointer checks · cd3468ba
      Johannes Berg authored
      These pointers can be NULL, the is_mesh() case isn't
      ever hit in the current kernel, but cmp_ies() can be
      hit under certain conditions.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: stable@kernel.org [2.6.29, 2.6.30]
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      cd3468ba
    • Yevgeny Petrilin's avatar
      mlx4_en: Fix double pci unmapping. · eb4ad826
      Yevgeny Petrilin authored
      In cases of fragmented skb, with the data pointers being wrapped around
      the TX buffer, the completion handling code would not forward the data
      pointer and the firs fragment was unmapped several times, while others
      were not unmapped at all.
      Signed-off-by: default avatarYevgeny Petrilin <yevgenyp@mellanox.co.il>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eb4ad826
  2. 02 Aug, 2009 11 commits
  3. 31 Jul, 2009 3 commits
  4. 30 Jul, 2009 9 commits
  5. 29 Jul, 2009 3 commits
  6. 28 Jul, 2009 1 commit
  7. 27 Jul, 2009 7 commits