Skip to content

Commit 263c6d7

Browse files
liuyonglong86davem330
authored andcommitted
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: 48189d6 ("net: hns: enet specifies a reference to dsaf") Reported-by: Alexey Khoroshilov <[email protected]> Signed-off-by: Yonglong Liu <[email protected]> Signed-off-by: Peng Li <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3da15ad commit 263c6d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/hisilicon/hns/hns_enet.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,6 +2418,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev)
24182418
out_notify_fail:
24192419
(void)cancel_work_sync(&priv->service_task);
24202420
out_read_prop_fail:
2421+
/* safe for ACPI FW */
2422+
of_node_put(to_of_node(priv->fwnode));
24212423
free_netdev(ndev);
24222424
return ret;
24232425
}
@@ -2447,6 +2449,9 @@ static int hns_nic_dev_remove(struct platform_device *pdev)
24472449
set_bit(NIC_STATE_REMOVING, &priv->state);
24482450
(void)cancel_work_sync(&priv->service_task);
24492451

2452+
/* safe for ACPI FW */
2453+
of_node_put(to_of_node(priv->fwnode));
2454+
24502455
free_netdev(ndev);
24512456
return 0;
24522457
}

0 commit comments

Comments
 (0)