]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mm/kmemleak: remove unreachable return statement in scan_should_stop()
authorZhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Fri, 30 Jan 2026 09:37:28 +0000 (17:37 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:53:02 +0000 (13:53 -0700)
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 <zhongqiu.han@oss.qualcomm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kmemleak.c

index d79acf5c51006c3ed42fd88a2246ca148e401999..2a24d9a4a835f0f12015653ed005f80669b7f882 100644 (file)
@@ -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();
 }
 
 /*