Re: [PATCH net] net: hns3: make sure ptp clock is unregister and freed if hclge_ptp_get_cycle returns an error

From: Simon Horman
Date: Tue Mar 04 2025 - 06:46:19 EST


On Fri, Feb 28, 2025 at 06:52:58PM +0800, Jijie Shao wrote:
> From: Peiyang Wang <wangpeiyang1@xxxxxxxxxx>
>
> During the initialization of ptp, hclge_ptp_get_cycle might return an error
> and returned directly without unregister clock and free it. To avoid that,
> call hclge_ptp_destroy_clock to unregist and free clock if
> hclge_ptp_get_cycle failed.
>
> Fixes: 8373cd38a888 ("net: hns3: change the method of obtaining default ptp cycle")
> Signed-off-by: Peiyang Wang <wangpeiyang1@xxxxxxxxxx>
> Signed-off-by: Jijie Shao <shaojijie@xxxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>