1. 11 9月, 2020 3 次提交
  2. 31 7月, 2020 1 次提交
  3. 30 7月, 2020 2 次提交
  4. 15 7月, 2020 1 次提交
  5. 11 7月, 2020 1 次提交
  6. 07 7月, 2020 1 次提交
  7. 22 6月, 2020 1 次提交
  8. 18 6月, 2020 10 次提交
  9. 13 6月, 2020 1 次提交
  10. 11 5月, 2020 4 次提交
  11. 05 4月, 2020 2 次提交
  12. 12 3月, 2020 1 次提交
  13. 11 3月, 2020 1 次提交
  14. 08 3月, 2020 2 次提交
  15. 28 2月, 2020 1 次提交
  16. 23 1月, 2020 2 次提交
  17. 16 1月, 2020 2 次提交
  18. 05 9月, 2019 1 次提交
    • G
      Bluetooth: mgmt: Use struct_size() helper · 72bb169e
      Gustavo A. R. Silva 提交于
      One of the more common cases of allocation size calculations is finding
      the size of a structure that has a zero-sized array at the end, along
      with memory for some number of elements for that array. For example:
      
      struct mgmt_rp_get_connections {
      	...
              struct mgmt_addr_info addr[0];
      } __packed;
      
      Make use of the struct_size() helper instead of an open-coded version
      in order to avoid any potential type mistakes.
      
      So, replace the following form:
      
      sizeof(*rp) + (i * sizeof(struct mgmt_addr_info));
      
      with:
      
      struct_size(rp, addr, i)
      
      Also, notice that, in this case, variable rp_len is not necessary,
      hence it is removed.
      
      This code was detected with the help of Coccinelle.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      72bb169e
  19. 24 4月, 2019 1 次提交
    • G
      Bluetooth: Use struct_size() helper · 5bec1fb8
      Gustavo A. R. Silva 提交于
      One of the more common cases of allocation size calculations is finding
      the size of a structure that has a zero-sized array at the end, along
      with memory for some number of elements for that array. For example:
      
      struct foo {
          int stuff;
          struct boo entry[];
      };
      
      size = sizeof(struct foo) + count * sizeof(struct boo);
      
      Instead of leaving these open-coded and prone to type mistakes, we can
      now use the new struct_size() helper:
      
      size = struct_size(instance, entry, count);
      
      This code was detected with the help of Coccinelle.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      5bec1fb8
  20. 26 2月, 2019 2 次提交