]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: ibm: fix possible object reference leak
authorWen Yang <wen.yang99@zte.com.cn>
Fri, 22 Mar 2019 03:04:08 +0000 (11:04 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitca4600f1b8654ca133e1e22c69a056be96a7f475
treeac07bb57402559c94207418c102c43fe0c8906d2
parent7208dab46346664b606857a5ff7a039583fe59b8
net: ibm: fix possible object reference leak

BugLink: https://bugs.launchpad.net/bugs/1838459
[ Upstream commit be693df3cf9dd113ff1d2c0d8150199efdba37f6 ]

The call to ehea_get_eth_dn 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/ibm/ehea/ehea_main.c:3163:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 3154, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Cc: Douglas Miller <dougmill@linux.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/ibm/ehea/ehea_main.c