]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
unwind: Simplify unwind_user_faultable()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 22 Sep 2025 13:49:14 +0000 (15:49 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 29 Oct 2025 09:29:56 +0000 (10:29 +0100)
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20250924080119.271671514@infradead.org
kernel/unwind/deferred.c

index 6395192d7225ef037629e9c46bdbf0abd038b34a..09617d8ae24bca662ba2dc3053e05e84937e0ecc 100644 (file)
@@ -128,17 +128,14 @@ int unwind_user_faultable(struct unwind_stacktrace *trace)
 
        cache = info->cache;
        trace->entries = cache->entries;
-
-       if (cache->nr_entries) {
-               /*
-                * The user stack has already been previously unwound in this
-                * entry context.  Skip the unwind and use the cache.
-                */
-               trace->nr = cache->nr_entries;
+       trace->nr = cache->nr_entries;
+       /*
+        * The user stack has already been previously unwound in this
+        * entry context.  Skip the unwind and use the cache.
+        */
+       if (trace->nr)
                return 0;
-       }
 
-       trace->nr = 0;
        unwind_user(trace, UNWIND_MAX_ENTRIES);
 
        cache->nr_entries = trace->nr;