]> git.dujemihanovic.xyz Git - linux.git/commit
net: hns3: release PTP resources if pf initialization failed
authorPeiyang Wang <wangpeiyang1@huawei.com>
Tue, 7 May 2024 13:42:21 +0000 (21:42 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 9 May 2024 08:47:32 +0000 (10:47 +0200)
commit950aa42399893a170d9b57eda0e4a3ff91fd8b70
tree8d8d94f14d9fad72b3d6d03d1abb4dcd86e460ed
parent6639a7b953212ac51aa4baa7d7fb855bf736cf56
net: hns3: release PTP resources if pf initialization failed

During the PF initialization process, hclge_update_port_info may return an
error code for some reason. At this point,  the ptp initialization has been
completed. To void memory leaks, the resources that are applied by ptp
should be released. Therefore, when hclge_update_port_info returns an error
code, hclge_ptp_uninit is called to release the corresponding resources.

Fixes: eaf83ae59e18 ("net: hns3: add querying fec ability from firmware")
Signed-off-by: Peiyang Wang <wangpeiyang1@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c