1. 25 3月, 2019 2 次提交
  2. 26 2月, 2019 1 次提交
    • W
      net: dsa: fix a leaked reference by adding missing of_node_put · 9919a363
      Wen Yang 提交于
      The call to of_parse_phandle returns a node pointer with refcount
      incremented thus it must be explicitly decremented after the last
      usage.
      
      Detected by coccinelle with the following warnings:
      ./net/dsa/port.c:294:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 284, but without a corresponding object release within this function.
      ./net/dsa/dsa2.c:627:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
      ./net/dsa/dsa2.c:630:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
      ./net/dsa/dsa2.c:636:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
      ./net/dsa/dsa2.c:639:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 618, but without a corresponding object release within this function.
      Signed-off-by: NWen Yang <wen.yang99@zte.com.cn>
      Reviewed-by: NVivien Didelot <vivien.didelot@gmail.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9919a363
  3. 09 2月, 2019 1 次提交
    • G
      net: dsa: use struct_size() in devm_kzalloc() · 33b363e0
      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);
      instance = alloc(size, GFP_KERNEL)
      
      Instead of leaving these open-coded and prone to type mistakes, we can
      now use the new struct_size() helper:
      
      instance = alloc(struct_size(instance, entry, count), GFP_KERNEL)
      
      Notice that, in this case, variable size 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>
      Reviewed-by: NVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      33b363e0
  4. 19 7月, 2018 1 次提交
  5. 20 5月, 2018 1 次提交
  6. 19 5月, 2018 1 次提交
  7. 24 1月, 2018 1 次提交
  8. 06 12月, 2017 1 次提交
  9. 26 11月, 2017 1 次提交
  10. 13 11月, 2017 1 次提交
  11. 09 11月, 2017 10 次提交
  12. 05 11月, 2017 10 次提交
  13. 01 11月, 2017 6 次提交
  14. 28 10月, 2017 1 次提交
  15. 27 10月, 2017 2 次提交