diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-10-22 17:40:17 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-27 00:21:59 +0300 |
commit | e2897b8238ab8fdee067cfe472dd52a3414d5716 (patch) | |
tree | 9fa683967270803fdb2ef8094ab1cba421fd841e /drivers/net/ethernet/ti/netcp_core.c | |
parent | f850b4a77d71a9cac513dadff91891a78c12ba05 (diff) | |
download | linux-e2897b8238ab8fdee067cfe472dd52a3414d5716.tar.xz |
net: netcp: add missing of_node_put() in netcp_probe()
This node pointer is returned by of_get_child_by_name() with refcount
incremented in this function. of_node_put() on it before exitting this
function.
This is detected by Coccinelle semantic patch.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/netcp_core.c')
-rw-r--r-- | drivers/net/ethernet/ti/netcp_core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c index 2fb5b6dd5231..78b4c831f5ad 100644 --- a/drivers/net/ethernet/ti/netcp_core.c +++ b/drivers/net/ethernet/ti/netcp_core.c @@ -2120,6 +2120,8 @@ static int netcp_probe(struct platform_device *pdev) } } + of_node_put(interfaces); + /* Add the device instance to the list */ list_add_tail(&netcp_device->device_list, &netcp_devices); @@ -2132,6 +2134,8 @@ probe_quit_interface: netcp_delete_interface(netcp_device, netcp_intf->ndev); } + of_node_put(interfaces); + probe_quit: pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); |