1. 13 12月, 2017 2 次提交
  2. 30 10月, 2017 1 次提交
  3. 29 10月, 2017 1 次提交
  4. 16 6月, 2017 2 次提交
    • J
      networking: make skb_put & friends return void pointers · 4df864c1
      Johannes Berg 提交于
      It seems like a historic accident that these return unsigned char *,
      and in many places that means casts are required, more often than not.
      
      Make these functions (skb_put, __skb_put and pskb_put) return void *
      and remove all the casts across the tree, adding a (u8 *) cast only
      where the unsigned char pointer was used directly, all done with the
      following spatch:
      
          @@
          expression SKB, LEN;
          typedef u8;
          identifier fn = { skb_put, __skb_put };
          @@
          - *(fn(SKB, LEN))
          + *(u8 *)fn(SKB, LEN)
      
          @@
          expression E, SKB, LEN;
          identifier fn = { skb_put, __skb_put };
          type T;
          @@
          - E = ((T *)(fn(SKB, LEN)))
          + E = fn(SKB, LEN)
      
      which actually doesn't cover pskb_put since there are only three
      users overall.
      
      A handful of stragglers were converted manually, notably a macro in
      drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
      instances in net/bluetooth/hci_sock.c. In the former file, I also
      had to fix one whitespace problem spatch introduced.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4df864c1
    • J
      networking: introduce and use skb_put_data() · 59ae1d12
      Johannes Berg 提交于
      A common pattern with skb_put() is to just want to memcpy()
      some data into the new space, introduce skb_put_data() for
      this.
      
      An spatch similar to the one for skb_put_zero() converts many
      of the places using it:
      
          @@
          identifier p, p2;
          expression len, skb, data;
          type t, t2;
          @@
          (
          -p = skb_put(skb, len);
          +p = skb_put_data(skb, data, len);
          |
          -p = (t)skb_put(skb, len);
          +p = skb_put_data(skb, data, len);
          )
          (
          p2 = (t2)p;
          -memcpy(p2, data, len);
          |
          -memcpy(p, data, len);
          )
      
          @@
          type t, t2;
          identifier p, p2;
          expression skb, data;
          @@
          t *p;
          ...
          (
          -p = skb_put(skb, sizeof(t));
          +p = skb_put_data(skb, data, sizeof(t));
          |
          -p = (t *)skb_put(skb, sizeof(t));
          +p = skb_put_data(skb, data, sizeof(t));
          )
          (
          p2 = (t2)p;
          -memcpy(p2, data, sizeof(*p));
          |
          -memcpy(p, data, sizeof(*p));
          )
      
          @@
          expression skb, len, data;
          @@
          -memcpy(skb_put(skb, len), data, len);
          +skb_put_data(skb, data, len);
      
      (again, manually post-processed to retain some comments)
      Reviewed-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      59ae1d12
  5. 02 3月, 2017 1 次提交
  6. 20 10月, 2016 1 次提交
  7. 06 10月, 2016 3 次提交
  8. 20 9月, 2016 4 次提交
  9. 24 8月, 2016 1 次提交
    • F
      Bluetooth: Fix memory leak at end of hci requests · 9afee949
      Frederic Dalleau 提交于
      In hci_req_sync_complete the event skb is referenced in hdev->req_skb.
      It is used (via hci_req_run_skb) from either __hci_cmd_sync_ev which will
      pass the skb to the caller, or __hci_req_sync which leaks.
      
      unreferenced object 0xffff880005339a00 (size 256):
        comm "kworker/u3:1", pid 1011, jiffies 4294671976 (age 107.389s)
        backtrace:
          [<ffffffff818d89d9>] kmemleak_alloc+0x49/0xa0
          [<ffffffff8116bba8>] kmem_cache_alloc+0x128/0x180
          [<ffffffff8167c1df>] skb_clone+0x4f/0xa0
          [<ffffffff817aa351>] hci_event_packet+0xc1/0x3290
          [<ffffffff8179a57b>] hci_rx_work+0x18b/0x360
          [<ffffffff810692ea>] process_one_work+0x14a/0x440
          [<ffffffff81069623>] worker_thread+0x43/0x4d0
          [<ffffffff8106ead4>] kthread+0xc4/0xe0
          [<ffffffff818dd38f>] ret_from_fork+0x1f/0x40
          [<ffffffffffffffff>] 0xffffffffffffffff
      Signed-off-by: NFrédéric Dalleau <frederic.dalleau@collabora.co.uk>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      9afee949
  10. 09 4月, 2016 1 次提交
  11. 11 3月, 2016 3 次提交
  12. 29 1月, 2016 1 次提交
    • J
      Bluetooth: Fix incorrect removing of IRKs · cff10ce7
      Johan Hedberg 提交于
      The commit cad20c27 was supposed to
      fix handling of devices first using public addresses and then
      switching to RPAs after pairing. Unfortunately it missed a couple of
      key places in the code.
      
      1. When evaluating which devices should be removed from the existing
      white list we also need to consider whether we have an IRK for them or
      not, i.e. a call to hci_find_irk_by_addr() is needed.
      
      2. In smp_notify_keys() we should not be requiring the knowledge of
      the RPA, but should simply keep the IRK around if the other conditions
      require it.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org # 4.4+
      cff10ce7
  13. 06 1月, 2016 1 次提交
  14. 10 12月, 2015 16 次提交
  15. 23 11月, 2015 1 次提交
  16. 20 11月, 2015 1 次提交