Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2897b82 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller
Browse files

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: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f850b4a7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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 @@ static int netcp_probe(struct platform_device *pdev)
		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);