From: Zhongqiu Han Date: Fri, 30 Jan 2026 09:37:28 +0000 (+0800) Subject: mm/kmemleak: remove unreachable return statement in scan_should_stop() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc9ef2978d440162f507f70cbc351006af9a77d4;p=thirdparty%2Fkernel%2Flinux.git mm/kmemleak: remove unreachable return statement in scan_should_stop() Patch series "mm/kmemleak: Improve scan_should_stop() implementation". This series improves the scan_should_stop() function by addressing code quality issues and enhancing kernel thread detection robustness. This patch (of 2): Remove unreachable "return 0;" statement as all execution paths return before reaching it. No functional change. Link: https://lkml.kernel.org/r/20260130093729.2045858-2-zhongqiu.han@oss.qualcomm.com Signed-off-by: Zhongqiu Han Acked-by: Catalin Marinas Signed-off-by: Andrew Morton --- diff --git a/mm/kmemleak.c b/mm/kmemleak.c index d79acf5c51006..2a24d9a4a835f 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1507,10 +1507,8 @@ static int scan_should_stop(void) */ if (current->mm) return signal_pending(current); - else - return kthread_should_stop(); - return 0; + return kthread_should_stop(); } /*