On Mar 21, Simon Horman wrote:
On Fri, Mar 20, 2026 at 09:42:28AM +0100, Lorenzo Bianconi wrote:
quoted
As suggested by Simon in [0], rework the code flow in airoha_remove()
and in the airoha_probe() error path in order to rely on a more common
approach un-registering configured net-devices first and destroying the
hw resources at the end of the code.
Introduce airoha_qdma_cleanup routine to release QDMA resources.
[0] https://lore.kernel.org/netdev/20251214-airoha-fix-dev-registration-v1-1-860e027ad4c6@kernel.org/ (local)
Suggested-by: Simon Horman <horms@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/airoha/airoha_eth.c | 82 ++++++++++++++++++--------------
1 file changed, 47 insertions(+), 35 deletions(-)
diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
...
quoted
@@ -3028,7 +3044,7 @@ static int airoha_probe(struct platform_device *pdev)
err = airoha_hw_init(pdev, eth);
if (err)
- goto error_hw_cleanup;
+ return err;
Hi Lorenzo,
AI generated review warns that eth->napi_dev is leaked here.
And that does seem to be the case.
Hi Simon,
right. I will fix it in v2.
Regards,
Lorenzo
quoted
for (i = 0; i < ARRAY_SIZE(eth->qdma); i++)
airoha_qdma_start_napi(ð->qdma[i]);
...