diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f294db835f4b..4deea62dbbac 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4126,6 +4126,7 @@ static int __init hugepages_setup(char *s) int count; unsigned long tmp; char *p = s; + int ret = 1; if (!parsed_valid_hugepagesz) { pr_warn("HugeTLB: hugepages=%s does not follow a valid hugepagesz, ignoring\n", s); @@ -4184,6 +4185,7 @@ static int __init hugepages_setup(char *s) } } +out: /* * Global state is always initialized later in hugetlb_init. * But we need to allocate gigantic hstates here early to still @@ -4194,11 +4196,12 @@ static int __init hugepages_setup(char *s) last_mhp = mhp; - return 1; + return ret; invalid: pr_warn("HugeTLB: Invalid hugepages parameter %s\n", p); - return 0; + ret = 0; + goto out; } __setup("hugepages=", hugepages_setup);