percpu: initialize best_upa variable
[sfrench/cifs-2.6.git] / mm / percpu.c
index e7b9ca82e9aa89f96620096165515751f71f170c..6667dfa0fcec16c4c181540bbd7136b9430cbd35 100644 (file)
@@ -2888,6 +2888,7 @@ static struct pcpu_alloc_info * __init __flatten pcpu_build_alloc_info(
         * Related to atom_size, which could be much larger than the unit_size.
         */
        last_allocs = INT_MAX;
+       best_upa = 0;
        for (upa = max_upa; upa; upa--) {
                int allocs = 0, wasted = 0;
 
@@ -2914,6 +2915,7 @@ static struct pcpu_alloc_info * __init __flatten pcpu_build_alloc_info(
                last_allocs = allocs;
                best_upa = upa;
        }
+       BUG_ON(!best_upa);
        upa = best_upa;
 
        /* allocate and fill alloc_info */