Commit 263c6d75 authored by Yonglong Liu's avatar Yonglong Liu Committed by David S. Miller

net: hns: Fix for missing of_node_put() after of_parse_phandle()

In hns enet driver, we use of_parse_handle() to get hold of the
device node related to "ae-handle" but we have missed to put
the node reference using of_node_put() after we are done using
the node. This patch fixes it.

Note:
This problem is stated in Link: https://lkml.org/lkml/2018/12/22/217

Fixes: 48189d6a ("net: hns: enet specifies a reference to dsaf")
Reported-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3da15ad3
...@@ -2418,6 +2418,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev) ...@@ -2418,6 +2418,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev)
out_notify_fail: out_notify_fail:
(void)cancel_work_sync(&priv->service_task); (void)cancel_work_sync(&priv->service_task);
out_read_prop_fail: out_read_prop_fail:
/* safe for ACPI FW */
of_node_put(to_of_node(priv->fwnode));
free_netdev(ndev); free_netdev(ndev);
return ret; return ret;
} }
...@@ -2447,6 +2449,9 @@ static int hns_nic_dev_remove(struct platform_device *pdev) ...@@ -2447,6 +2449,9 @@ static int hns_nic_dev_remove(struct platform_device *pdev)
set_bit(NIC_STATE_REMOVING, &priv->state); set_bit(NIC_STATE_REMOVING, &priv->state);
(void)cancel_work_sync(&priv->service_task); (void)cancel_work_sync(&priv->service_task);
/* safe for ACPI FW */
of_node_put(to_of_node(priv->fwnode));
free_netdev(ndev); free_netdev(ndev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment