diff options
Diffstat (limited to 'modutils/modprobe.c')
-rw-r--r-- | modutils/modprobe.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 0e8aa9e85..996de4074 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
@@ -260,7 +260,7 @@ static void add_probe(const char *name) | |||
260 | llist_add_to_end(&G.probes, m); | 260 | llist_add_to_end(&G.probes, m); |
261 | G.num_unresolved_deps++; | 261 | G.num_unresolved_deps++; |
262 | if (ENABLE_FEATURE_MODUTILS_SYMBOLS | 262 | if (ENABLE_FEATURE_MODUTILS_SYMBOLS |
263 | && strncmp(m->modname, "symbol:", 7) == 0 | 263 | && is_prefixed_with(m->modname, "symbol:") |
264 | ) { | 264 | ) { |
265 | G.need_symbols = 1; | 265 | G.need_symbols = 1; |
266 | } | 266 | } |
@@ -353,22 +353,18 @@ static char *parse_and_add_kcmdline_module_options(char *options, const char *mo | |||
353 | char *kcmdline_buf; | 353 | char *kcmdline_buf; |
354 | char *kcmdline; | 354 | char *kcmdline; |
355 | char *kptr; | 355 | char *kptr; |
356 | int len; | ||
357 | 356 | ||
358 | kcmdline_buf = xmalloc_open_read_close("/proc/cmdline", NULL); | 357 | kcmdline_buf = xmalloc_open_read_close("/proc/cmdline", NULL); |
359 | if (!kcmdline_buf) | 358 | if (!kcmdline_buf) |
360 | return options; | 359 | return options; |
361 | 360 | ||
362 | kcmdline = kcmdline_buf; | 361 | kcmdline = kcmdline_buf; |
363 | len = strlen(modulename); | ||
364 | while ((kptr = strsep(&kcmdline, "\n\t ")) != NULL) { | 362 | while ((kptr = strsep(&kcmdline, "\n\t ")) != NULL) { |
365 | if (strncmp(modulename, kptr, len) != 0) | 363 | char *after_modulename = is_prefixed_with(kptr, modulename); |
366 | continue; | 364 | if (!after_modulename || *after_modulename != '.') |
367 | kptr += len; | ||
368 | if (*kptr != '.') | ||
369 | continue; | 365 | continue; |
370 | /* It is "modulename.xxxx" */ | 366 | /* It is "modulename.xxxx" */ |
371 | kptr++; | 367 | kptr = after_modulename + 1; |
372 | if (strchr(kptr, '=') != NULL) { | 368 | if (strchr(kptr, '=') != NULL) { |
373 | /* It is "modulename.opt=[val]" */ | 369 | /* It is "modulename.opt=[val]" */ |
374 | options = gather_options_str(options, kptr); | 370 | options = gather_options_str(options, kptr); |