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

From: Krzysztof Kozlowski

Date: Fri Oct 09 2026 - 05:41:54 EST


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