Re: [PATCH net-next] net: netconsole: Populate dynamic entry even if netpoll fails
From: Paolo Abeni
Date: Tue Aug 13 2024 - 07:55:43 EST
On 8/9/24 18:19, Breno Leitao wrote:> @@ -1304,8 +1308,6 @@ static int
__init init_netconsole(void)
while ((target_config = strsep(&input, ";"))) {
nt = alloc_param_target(target_config, count);
if (IS_ERR(nt)) {
- if (IS_ENABLED(CONFIG_NETCONSOLE_DYNAMIC))
- continue;
err = PTR_ERR(nt);
goto fail;
}
AFAICS the above introduces a behavior change: if
CONFIG_NETCONSOLE_DYNAMIC is enabled, and the options parsing fails for
any targets in the command line, all the targets will be removed.
I think the old behavior is preferable - just skip the targets with
wrong options.
Side note: I think the error paths in __netpoll_setup() assume the
struct netpoll will be freed in case of error, e.g. the device refcount
is released but np->dev is not cleared, I fear we could hit a reference
underflow on <setup error>, <disable>
Paolo