[PATCH] clk: xilinx: fix NULL pointer dereference in xvcu_clk_hw_unregister_leaf()

Krzysztof Kozlowski krzk at kernel.org
Fri Oct 9 02:41:35 PDT 2026


On 09/10/2026 08:18, Haotian Zhang wrote:
> xvcu_clk_hw_unregister_leaf() gets the mux with
> clk_hw_get_parent(divider), which returns NULL when the divider has no
> parent, and passes it to clk_hw_unregister_mux() without checking it.
> The following check tests the wrong variable: divider has already been
> verified to be non-NULL at this point, so "if (!divider) return;" is
> dead code and a NULL mux is dereferenced, crashing in
> clk_hw_unregister_mux().
> 
> Only unregister the mux when it is non-NULL, and always release the
> divider.

So you fired up your OpenClaw or whatever LLM tool and don't bother to
slow down, right?

Best regards,
Krzysztof



More information about the linux-arm-kernel mailing list