diff options
Diffstat (limited to 'kernel/params.c')
-rw-r--r-- | kernel/params.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/kernel/params.c b/kernel/params.c index 16f269e9ddc9..2a4c51487e72 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -592,19 +592,16 @@ static void __init param_sysfs_builtin(void) | |||
592 | 592 | ||
593 | for (i=0; i < __stop___param - __start___param; i++) { | 593 | for (i=0; i < __stop___param - __start___param; i++) { |
594 | char *dot; | 594 | char *dot; |
595 | size_t kplen; | 595 | size_t max_name_len; |
596 | 596 | ||
597 | kp = &__start___param[i]; | 597 | kp = &__start___param[i]; |
598 | kplen = strlen(kp->name); | 598 | max_name_len = |
599 | min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp->name)); | ||
599 | 600 | ||
600 | /* We do not handle args without periods. */ | 601 | dot = memchr(kp->name, '.', max_name_len); |
601 | if (kplen > MAX_KBUILD_MODNAME) { | ||
602 | DEBUGP("kernel parameter name is too long: %s\n", kp->name); | ||
603 | continue; | ||
604 | } | ||
605 | dot = memchr(kp->name, '.', kplen); | ||
606 | if (!dot) { | 602 | if (!dot) { |
607 | DEBUGP("couldn't find period in %s\n", kp->name); | 603 | DEBUGP("couldn't find period in first %d characters " |
604 | "of %s\n", MAX_KBUILD_MODNAME, kp->name); | ||
608 | continue; | 605 | continue; |
609 | } | 606 | } |
610 | name_len = dot - kp->name; | 607 | name_len = dot - kp->name; |