* [PATCH] dpll: zl3073x: Remove redundant cleanup in devm_dpll_init()
@ 2026-02-23 13:20 Felix Gu
2026-02-23 14:17 ` Ivan Vecera
0 siblings, 1 reply; 3+ messages in thread
From: Felix Gu @ 2026-02-23 13:20 UTC (permalink / raw)
To: Ivan Vecera, Prathosh Satish, Vadim Fedorenko,
Arkadiusz Kubalewski, Jiri Pirko, Jakub Kicinski, Przemek Kitszel
Cc: netdev, linux-kernel, 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 subsequent zl3073x_dev_dpll_fini() call causes double cleanup.
Fixes: ebb1031c5137 ("dpll: zl3073x: Refactor DPLL initialization")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/dpll/zl3073x/core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/dpll/zl3073x/core.c b/drivers/dpll/zl3073x/core.c
index 63bd97181b9e..4ad21caec0e8 100644
--- a/drivers/dpll/zl3073x/core.c
+++ b/drivers/dpll/zl3073x/core.c
@@ -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,
--
Felix Gu <ustc.gu@gmail.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dpll: zl3073x: Remove redundant cleanup in devm_dpll_init()
2026-02-23 13:20 [PATCH] dpll: zl3073x: Remove redundant cleanup in devm_dpll_init() Felix Gu
@ 2026-02-23 14:17 ` Ivan Vecera
2026-02-24 10:13 ` Felix Gu
0 siblings, 1 reply; 3+ messages in thread
From: Ivan Vecera @ 2026-02-23 14:17 UTC (permalink / raw)
To: Felix Gu, Prathosh Satish, Vadim Fedorenko, Arkadiusz Kubalewski,
Jiri Pirko, Jakub Kicinski, Przemek Kitszel
Cc: netdev, linux-kernel
On 2/23/26 2:20 PM, Felix Gu wrote:
> 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.
>
> Fixes: ebb1031c5137 ("dpll: zl3073x: Refactor DPLL initialization")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---
> drivers/dpll/zl3073x/core.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/dpll/zl3073x/core.c b/drivers/dpll/zl3073x/core.c
> index 63bd97181b9e..4ad21caec0e8 100644
> --- a/drivers/dpll/zl3073x/core.c
> +++ b/drivers/dpll/zl3073x/core.c
> @@ -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:
Reviewed-by: Ivan Vecera <ivecera@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dpll: zl3073x: Remove redundant cleanup in devm_dpll_init()
2026-02-23 14:17 ` Ivan Vecera
@ 2026-02-24 10:13 ` Felix Gu
0 siblings, 0 replies; 3+ messages in thread
From: Felix Gu @ 2026-02-24 10:13 UTC (permalink / raw)
To: Ivan Vecera
Cc: Prathosh Satish, Vadim Fedorenko, Arkadiusz Kubalewski,
Jiri Pirko, Jakub Kicinski, Przemek Kitszel, netdev, linux-kernel
> Please use:
>
> return devm_add_action_or_reset(...);
>
> Otherwise, LGTM. With this change:
>
> Reviewed-by: Ivan Vecera <ivecera@redhat.com>
>
Hi Ivan,
Thanks for the review.
I will update it in V2.
Best regards,
Felix
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-24 10:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23 13:20 [PATCH] dpll: zl3073x: Remove redundant cleanup in devm_dpll_init() Felix Gu
2026-02-23 14:17 ` Ivan Vecera
2026-02-24 10:13 ` Felix Gu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox