Re: [PATCH] staging: most: net: Preserve network device registration errors

From: gregkh@xxxxxxxxxxxxxxxxxxx

Date: Fri Nov 20 2026 - 02:16:46 EST


On Wed, Nov 11, 2026 at 02:42:07AM +0000, Zachary Aflalo wrote:
> From: Zachary Aflalo <zachary@xxxxxxxxxx>
>
> comp_probe_channel() replaces every register_netdev() failure with
> -EINVAL. This hides errors such as -ENOMEM and -EINTR from the MOST core
> and the configfs create_link interface.
>
> Save the registration error and return it through the existing unlock
> path. Keep mapping -ENODEV to -EINVAL because configfs uses -ENODEV to
> accept a deferred link when the device or component is missing. Returning
> that error for a failed registration would incorrectly acknowledge the
> link request as deferred configuration.
>
> Codex assisted the source review, implementation, and commit message.
>
> Fixes: d4a8ce7f57fc ("Staging: most: add MOST driver's aim-network module")
> Signed-off-by: Zachary Aflalo <zachary@xxxxxxxxxx>
> ---
> Validation:
> Built the original and final driver objects on Debian ARM64 with
> GCC 14.2.0, W=1 and C=2, using upstream sparse at
> 84ec0658c81db4ccc4aabc420d3dc118c2c6a310. No driver diagnostics or new
> warnings. Both versions produce the same unrelated sparse warning in
> arch/arm64/kernel/vdso/vgetrandom.c for __kernel_getrandom.
>
> Extracted-function tests with mocked dependencies cover both channel
> directions, registration failures (including -ENODEV), successful
> registration, duplicate-link rejection, lock balance, and the actual
> configfs create_link store function. These are native userspace tests,
> not kernel runtime or hardware tests. No physical MOST hardware tested.
>
> AI assistance:
> Codex inspected staging error paths, proposed this focused correction,
> checked caller behavior, wrote the change and mocked tests, and drafted
> this message. The prompts requested a small meaningful staging fix,
> preservation of existing behavior, and validation before submission.
> drivers/staging/most/net/net.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)

Please read:
https://lore.kernel.org/r/2026080354-skater-urgent-31b2@gregkh