Merge branch 'core/percpu' into stackprotector
[firefly-linux-kernel-4.4.55.git] / kernel / exit.c
index c7740fa3252cb0ab24d8f07bd89acf47006c3d60..2a803c28df9e6ed8e6dbaa6cd5d57f23c8367ba8 100644 (file)
@@ -977,12 +977,9 @@ static void check_stack_usage(void)
 {
        static DEFINE_SPINLOCK(low_water_lock);
        static int lowest_to_date = THREAD_SIZE;
-       unsigned long *n = end_of_stack(current);
        unsigned long free;
 
-       while (*n == 0)
-               n++;
-       free = (unsigned long)n - (unsigned long)end_of_stack(current);
+       free = stack_not_used(current);
 
        if (free >= lowest_to_date)
                return;