• Wen Yang's avatar
    net: dsa: fix a leaked reference by adding missing of_node_put · 9919a363
    Wen Yang authored
    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: default avatarWen Yang <wen.yang99@zte.com.cn>
    Reviewed-by: default avatarVivien 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: default avatarDavid S. Miller <davem@davemloft.net>
    9919a363
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
dsa.c Loading commit data...
dsa2.c Loading commit data...
dsa_priv.h Loading commit data...
legacy.c Loading commit data...
master.c Loading commit data...
port.c Loading commit data...
slave.c Loading commit data...
switch.c Loading commit data...
tag_brcm.c Loading commit data...
tag_dsa.c Loading commit data...
tag_edsa.c Loading commit data...
tag_gswip.c Loading commit data...
tag_ksz.c Loading commit data...
tag_lan9303.c Loading commit data...
tag_mtk.c Loading commit data...
tag_qca.c Loading commit data...
tag_trailer.c Loading commit data...