kmodloader: fix insmod when the passed parameter is a valid path
authorJohn Crispin <blogic@openwrt.org>
Wed, 26 Feb 2014 06:02:07 +0000 (06:02 +0000)
committerJohn Crispin <blogic@openwrt.org>
Wed, 26 Feb 2014 11:29:29 +0000 (11:29 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
kmodloader.c

index db4574e27d25005228baf740cc81db53c9351945..770484b34cc8ecec2f8ea0d00c37249794139e32 100644 (file)
@@ -540,7 +540,9 @@ static int main_insmod(int argc, char **argv)
                cur += sprintf(cur, "%s", argv[i]);
        }
 
-       if (!get_module_path(name)) {
+       if (get_module_path(argv[1])) {
+               name = argv[1];
+       } else if (!get_module_path(name)) {
                fprintf(stderr, "Failed to find %s. Maybe it is a built in module ?\n", name);
                return -1;
        }