Re: [PATCH net] net: txgbe: free the fixed-rate clock on cleanup

From: Simon Horman

Date: Mon Sep 14 2026 - 04:31:10 EST


On Fri, Sep 11, 2026 at 11:53:18AM -0400, Myeonghun Pak wrote:
> The fixed-rate clock is registered with clk_register_fixed_rate(), but
> its error and removal paths use clk_unregister(). That unregisters the
> clock without freeing the fixed-rate provider allocation.
>
> Use clk_unregister_fixed_rate() on lookup creation failure, later PHY
> initialization failure and removal to release the provider allocation as
> well. Keep the existing clock registration and lookup cleanup ordering.
>
> This issue was identified during our ongoing static-analysis research while
> reviewing kernel code.
>
> Fixes: b63f20485e43 ("net: txgbe: Register fixed rate clock")
> Assisted-by: OpenAI:GPT-5.6
> Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>