diff mbox series

soc: xilinx: vcu: modify the order of devices unregistration

Message ID 20250324061543.15150-1-a.vatoropin@crpt.ru (mailing list archive)
State Under Review
Headers show
Series soc: xilinx: vcu: modify the order of devices unregistration | expand

Commit Message

Ваторопин Андрей March 24, 2025, 6:15 a.m. UTC
From: Andrey Vatoropin <a.vatoropin@crpt.ru>

The order of registration of 'struct clk_hw' handles in
xvcu_clk_hw_register_leaf() does not correspond the order of
unregistration performed in xvcu_clk_hw_unregister_leaf().

Clean up the order and replace the duplicate !divider check with a more
appropriate one.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
---
 drivers/clk/xilinx/xlnx_vcu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c
index 81501b48412e..e4b08f501958 100644
--- a/drivers/clk/xilinx/xlnx_vcu.c
+++ b/drivers/clk/xilinx/xlnx_vcu.c
@@ -511,11 +511,11 @@  static void xvcu_clk_hw_unregister_leaf(struct clk_hw *hw)
 		return;
 
 	mux = clk_hw_get_parent(divider);
-	clk_hw_unregister_mux(mux);
-	if (!divider)
+	clk_hw_unregister_divider(divider);
+	if (!mux)
 		return;
 
-	clk_hw_unregister_divider(divider);
+	clk_hw_unregister_mux(mux);
 }
 
 static int xvcu_register_clock_provider(struct xvcu_device *xvcu)