diff options
-rw-r--r-- | modutils/modprobe.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index d1adaf8e1..ce8b0b886 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
@@ -207,7 +207,7 @@ static struct module_entry *helper_get_module(const char *module, int create) | |||
207 | unsigned i; | 207 | unsigned i; |
208 | unsigned hash; | 208 | unsigned hash; |
209 | 209 | ||
210 | filename2modname(bb_get_last_path_component_nostrip(module), modname); | 210 | filename2modname(module, modname); |
211 | 211 | ||
212 | hash = 0; | 212 | hash = 0; |
213 | for (i = 0; modname[i]; i++) | 213 | for (i = 0; modname[i]; i++) |
@@ -232,9 +232,14 @@ static ALWAYS_INLINE struct module_entry *get_or_add_modentry(const char *module | |||
232 | { | 232 | { |
233 | return helper_get_module(module, 1); | 233 | return helper_get_module(module, 1); |
234 | } | 234 | } |
235 | static ALWAYS_INLINE struct module_entry *get_modentry(const char *module) | 235 | /* So far this function always gets a module pathname, never an alias name. |
236 | * The crucial difference is that pathname needs dirname stripping, | ||
237 | * while alias name must NOT do it! | ||
238 | * Testcase where dirname stripping is likely to go wrong: "modprobe devname:snd/timer" | ||
239 | */ | ||
240 | static ALWAYS_INLINE struct module_entry *get_modentry(const char *pathname) | ||
236 | { | 241 | { |
237 | return helper_get_module(module, 0); | 242 | return helper_get_module(bb_get_last_path_component_nostrip(pathname), 0); |
238 | } | 243 | } |
239 | 244 | ||
240 | static void add_probe(const char *name) | 245 | static void add_probe(const char *name) |
@@ -502,7 +507,7 @@ static void load_modules_dep(void) | |||
502 | colon = last_char_is(tokens[0], ':'); | 507 | colon = last_char_is(tokens[0], ':'); |
503 | if (colon == NULL) | 508 | if (colon == NULL) |
504 | continue; | 509 | continue; |
505 | *colon = 0; | 510 | *colon = '\0'; |
506 | 511 | ||
507 | m = get_modentry(tokens[0]); | 512 | m = get_modentry(tokens[0]); |
508 | if (m == NULL) | 513 | if (m == NULL) |