[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190225.093520.1888476051243130091.davem@davemloft.net>
Date: Mon, 25 Feb 2019 09:35:20 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: wen.yang99@....com.cn
Cc: andrew@...n.ch, vivien.didelot@...il.com, f.fainelli@...il.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
wang.yi59@....com.cn
Subject: Re: [PATCH v2] net: dsa: fix a leaked reference by adding missing
of_node_put
From: Wen Yang <wen.yang99@....com.cn>
Date: Mon, 25 Feb 2019 15:22:19 +0800
> 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: Wen Yang <wen.yang99@....com.cn>
> Reviewed-by: Vivien Didelot <vivien.didelot@...il.com>
> Reviewed-by: "David S. Miller" <davem@...emloft.net>
Applied.
Powered by blists - more mailing lists