fix segfault in kmodloader when no modules path was present
authorJohn Crispin <john@phrozen.org>
Wed, 17 Aug 2016 02:32:43 +0000 (04:32 +0200)
committerJohn Crispin <john@phrozen.org>
Wed, 17 Aug 2016 02:34:14 +0000 (04:34 +0200)
Signed-off-by: John Crispin <john@phrozen.org>
kmodloader.c

index e32e6affb64899a366cb81f6483865a061160891..5ba75c1aa36d24282991708c8bca019b5faa03ac 100644 (file)
@@ -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];