Sergiy Kibrik <[email protected]> writes: > Otherwise modules with long names, e.g. lttng (>32 chars) can't be loaded. > > Signed-off-by: Sergiy Kibrik <[email protected]> > --- > kmodloader.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kmodloader.c b/kmodloader.c > index 3196deb..67e3706 100644 > --- a/kmodloader.c > +++ b/kmodloader.c > @@ -157,7 +157,7 @@ static char* get_module_path(char *name) > > static char* get_module_name(char *path) > { > - static char name[33]; > + static char name[NAME_MAX]; > char *t; > > strncpy(name, basename(path), sizeof(name) - 1);
Agreed that 33 is not enough, but NAME_MAX is way overkill again. Why not use the actual max length from the kernel?: include/linux/module.h:#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN include/linux/moduleparam.h:#define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) Bjørn _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
