From 34c597b8f478a4937fa041bf9da988990314ea85 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 17 Aug 2016 04:32:43 +0200 Subject: [PATCH] fix segfault in kmodloader when no modules path was present Signed-off-by: John Crispin --- kmodloader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmodloader.c b/kmodloader.c index e32e6af..5ba75c1 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -609,7 +609,10 @@ static int main_insmod(int argc, char **argv) cur += sprintf(cur, "%s", argv[i]); } - init_module_folders(); + if (init_module_folders()) { + fprintf(stderr, "falied to find the folder holding the modules\n"); + return -1; + } if (get_module_path(argv[1])) { name = argv[1]; -- 2.25.1