dpll: zl3073x: Remove redundant cleanup in devm_dpll_init()
Subsystems (4)
PATCH 1/1 dpll: zl3073x: Remove redundant cleanup in devm_dpll_init()
The devm_add_action_or_reset() function already executes the cleanup action on failure before returning an error, so the explicit goto error and subsequent zl3073x_dev_dpll_fini() call causes double cleanup.
--- drivers/dpll/zl3073x/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/dpll/zl3073x/core.c +1 -3
@@ -982,10 +982,8 @@ zl3073x_devm_dpll_init(struct zl3073x_dev *zldev, u8 num_dplls)/* Add devres action to release DPLL related resources */ rc =devm_add_action_or_reset (zldev->dev, zl3073x_dev_dpll_fini, zldev); -if (rc) - goto error; -return 0 ; +return rc; error:zl3073x_dev_dpll_fini (zldev);
---
base-commit: d4906ae14a5f136ceb671bb14cedbf13fa560da6
change-id: 20260223-dpll-40c3c8b2ab38
Best regards,
Signature · 1 line
Felix Gu <[email protected]>
Quoted 15 lines · Felix Gu
The
devm_add_action_or_reset()function already executes the cleanup action on failure before returning an error, so the explicit goto error and subsequentzl3073x_dev_dpll_fini()call causes double cleanup.Fixes ebb1031c5137 ("dpll: zl3073x: Refactor DPLL initialization")Signed-off-by Felix Gu <[email protected]>--- drivers/dpll/zl3073x/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/dpll/zl3073x/core.c +0
-0
drivers/dpll/zl3073x/core.c zl3073x_devm_dpll_init(struct zl3073x_dev *zldev, u8 num_dplls) · line 986
Quoted 8 lines
drivers/dpll/zl3073x/core.c +1
-3@@ -982,10 +982,8 @@ zl3073x_devm_dpll_init(struct zl3073x_dev *zldev, u8 num_dplls)/* Add devres action to release DPLL related resources */ rc =devm_add_action_or_reset (zldev->dev, zl3073x_dev_dpll_fini, zldev); -if (rc) - goto error; -return 0 ; +return rc;
Please use:
return devm_add_action_or_reset(...);
Otherwise, LGTM. With this change:
Quoted 8 lines
Please use:
return
devm_add_action_or_reset(...);Otherwise, LGTM. With this change:
Reviewed-by Ivan Vecera <[email protected]>
Hi Ivan,
Thanks for the review.
I will update it in V2.
Best regards,
Felix