net: xilinx: fix possible object reference leak
authorWen Yang <wen.yang99@zte.com.cn>
Fri, 22 Mar 2019 03:04:07 +0000 (11:04 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Mar 2019 01:21:24 +0000 (21:21 -0400)
commitfa3a419d2f674b431d38748cb58fb7da17ee8949
tree7e755440f7102c7936bbca82691f7f830305a79e
parenta7fb107b7d8982ac76c958a0d2838a151b03e97e
net: xilinx: fix possible object reference leak

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:
./drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1624:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1569, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Cc: Anirudha Sarangi <anirudh@xilinx.com>
Cc: John Linn <John.Linn@xilinx.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c