soc: xilinx: vcu: issue with 2nd null check on pointer divider
Colin King (gmail)
colin.i.king at gmail.com
Thu May 8 03:21:05 PDT 2025
Hi,
There seems to be an issue with the following function with the second
check on if (!divider). Firstly this is redundant code since divider has
already been null checked, so I suspect it should be instead if (!mux)
but I'm unsure if this is correct since the call to
clk_hw_unregister_divider is not made. Also if mux is null, isn't the
call to clk_hw_unregister_mux() problematic as a null pointer is being
passed to it.
static void xvcu_clk_hw_unregister_leaf(struct clk_hw *hw)
{
struct clk_hw *gate = hw;
struct clk_hw *divider;
struct clk_hw *mux;
if (!gate)
return;
divider = clk_hw_get_parent(gate);
clk_hw_unregister_gate(gate);
if (!divider)
return;
mux = clk_hw_get_parent(divider);
clk_hw_unregister_mux(mux);
if (!divider)
return;
clk_hw_unregister_divider(divider);
}
Colin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x68C287DFC6A80226.asc
Type: application/pgp-keys
Size: 4824 bytes
Desc: OpenPGP public key
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20250508/800dd273/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20250508/800dd273/attachment.sig>
More information about the linux-arm-kernel
mailing list