mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* soc: xilinx: vcu: issue with 2nd null check on pointer divider
@ 2025-05-08 10:21 Colin King (gmail)
  2025-05-08 10:57 ` Michael Tretter
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King (gmail) @ 2025-05-08 10:21 UTC (permalink / raw)
  To: Michael Tretter, linux-arm-kernel
  Cc: Stephen Boyd, Michal Simek, linux-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 987 bytes --]

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

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 4901 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-08 11:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-08 10:21 soc: xilinx: vcu: issue with 2nd null check on pointer divider Colin King (gmail)
2025-05-08 10:57 ` Michael Tretter
2025-05-08 11:04   ` Colin King (gmail)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®