From: Peter Zijlstra Date: Mon, 22 Sep 2025 13:49:14 +0000 (+0200) Subject: unwind: Simplify unwind_user_faultable() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42b9138f81fc22c36128f9524bb21bc9eabfb1b8;p=thirdparty%2Flinux.git unwind: Simplify unwind_user_faultable() Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20250924080119.271671514@infradead.org --- diff --git a/kernel/unwind/deferred.c b/kernel/unwind/deferred.c index 6395192d7225e..09617d8ae24bc 100644 --- a/kernel/unwind/deferred.c +++ b/kernel/unwind/deferred.c @@ -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;