From a782779552a0d68e3bb588e3039eb95da15ec7b0 Mon Sep 17 00:00:00 2001 From: Sergiy Kibrik Date: Fri, 22 Feb 2019 06:57:52 +0000 Subject: [PATCH] kmodloader: increase module name length Otherwise modules with long names, e.g. lttng (>32 chars) can't be loaded. Signed-off-by: Sergiy Kibrik --- kmodloader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kmodloader.c b/kmodloader.c index 3196deb..2e920ef 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -37,6 +37,8 @@ #include #define DEF_MOD_PATH "/modules/%s/" +/* duplicated from in-kernel include/linux/module.h */ +#define MODULE_NAME_LEN (64 - sizeof(unsigned long)) enum { SCANNED, @@ -157,7 +159,7 @@ static char* get_module_path(char *name) static char* get_module_name(char *path) { - static char name[33]; + static char name[MODULE_NAME_LEN]; char *t; strncpy(name, basename(path), sizeof(name) - 1); -- 2.30.2