kmodloader: support duplicate module names and aliases master
authorTony Ambardar <itugrok@yahoo.com>
Sat, 27 Jan 2024 11:41:56 +0000 (03:41 -0800)
committerTony Ambardar <itugrok@yahoo.com>
Sat, 2 Mar 2024 21:56:56 +0000 (13:56 -0800)
commitd413903016c4dc9190926e38ff72fbf7d3d69115
tree2deff854eff6203694d611e0dce3698901f5e228
parent1c9aaefc119a908c6a9849e96330443c7439e5d1
kmodloader: support duplicate module names and aliases

Allow duplicate keys in the 'modules' avl tree, fixing an indirect memory
leak observed during testing. Given avl keys treat '_' and '-' equally,
some modules may have aliases duplicating their own names under this
mapping, so skip adding these redundant avl tree nodes in alloc_module().

With the above support, update 'modinfo' to print details for all modules
matching the cmdline name, rather than only the first. This is the expected
behaviour and consistent with upstream. The behaviour of other kmodloader
applets, such as boot-time loading or modprobe, remains unchanged.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
kmodloader.c