From: Simon Horman <horms@kernel.org>
To: rafael@kernel.org
Cc: Simon Horman <horms@kernel.org>,
linux-acpi@vger.kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, kuba@kernel.org, edumazet@google.com,
andrew+netdev@lunn.ch, linux-kernel@vger.kernel.org,
davem@davemloft.net
Subject: Re: [v1] net: fjes: Drop fjes_acpi_driver and rework initialization
Date: Tue, 17 Mar 2026 16:42:14 +0000 [thread overview]
Message-ID: <20260317164215.1766861-1-horms@kernel.org> (raw)
In-Reply-To: <5113731.31r3eYUQgx@rafael.j.wysocki>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: fjes: Drop fjes_acpi_driver and rework initialization
This commit reworks the Fujitsu Extended Socket (fjes) Network Device
driver initialization by removing the ACPI driver interface and
creating the platform device directly during module initialization.
Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1]
> diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
> index b63965d9a1ba..efb399eb15e0 100644
> --- a/drivers/net/fjes/fjes_main.c
> +++ b/drivers/net/fjes/fjes_main.c
[ ... ]
> @@ -1518,16 +1506,7 @@ static int __init fjes_init_module(void)
> return result;
> }
>
> - result = acpi_bus_register_driver(&fjes_acpi_driver);
> - if (result < 0)
> - goto fail_acpi_driver;
> -
> return 0;
> -
> -fail_acpi_driver:
> - platform_driver_unregister(&fjes_driver);
> - fjes_dbg_exit();
> - return result;
> }
In fjes_init_module(), if platform_driver_register() fails, does this
leak the platform device?
Looking at the new code, the platform device is successfully registered
earlier in the function:
fjes_plat_dev = platform_device_register_full(&pdevinfo);
...
if (IS_ERR(fjes_plat_dev))
return PTR_ERR(fjes_plat_dev);
...
result = platform_driver_register(&fjes_driver);
But when platform_driver_register() fails, the error path only calls
fjes_dbg_exit() and returns:
result = platform_driver_register(&fjes_driver);
if (result < 0) {
fjes_dbg_exit();
return result;
}
Since the module init fails, fjes_exit_module() will never run, so
the platform_device_unregister() call there won't happen either. Should
the error path call platform_device_unregister(fjes_plat_dev) before
returning?
next prev parent reply other threads:[~2026-03-17 16:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 11:47 [PATCH v1] net: fjes: Drop fjes_acpi_driver and rework initialization Rafael J. Wysocki
2026-03-17 16:42 ` Simon Horman [this message]
2026-03-18 13:00 ` [v1] " Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260317164215.1766861-1-horms@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox