From 48b5b9eb80c224e5e58c0df27485a92dfea40ee0 Mon Sep 17 00:00:00 2001
From: Michal Hocko <mhocko@suse.com>
Date: Jun 11 2025 13:41:37 +0000
Subject: scripts/check-kernel-fix: fix -F warning reporting


scripts/check-kernel-fix -F will report all eligible branches even if
there is no fixes tag. Without -F only branches with warnings are
reported. The reporting doesn't work correctly with the -F mode
$ scripts/check-kernel-fix -F CVE-2025-37942
Security fix for CVE-2025-37942 bsc#1243576 with CVSS 4.7
= 1f650dcec32d ("HID: pidff: Make sure to fetch pool before checking SIMULTANEOUS_MAX") merged v6.15-rc1~171^2~5^2~10
No Fixes tag. Requires manual review for affected branches.
Experts candidates:  jkosina@suse.com (25) subsystem/role="Signed-off-by"
Link: https://git.kernel.org/linus/1f650dcec32d22deb1d6db12300a2b98483099a9
SLE12-SP3-TD: MANUAL: might need backport of 1f650dcec32d22deb1d6db12300a2b98483099a9 ()
SLE12-SP5: MANUAL: might need backport of 1f650dcec32d22deb1d6db12300a2b98483099a9 ()
SLE15-SP6: MANUAL: might need backport of 1f650dcec32d22deb1d6db12300a2b98483099a9 ()
All eligible branches have warnings. If they are correct then there is NO ACTION NEEDED for 1f650dcec32d22deb1d6db12300a2b98483099a9
ACTION NEEDED!

Potential git-fixes for 1f650dcec32d22deb1d6db12300a2b98483099a9
Nothing found

It claims that all eligible branches have warning which is not correct
because there are clearly none. We simply cannot increase branches_with_warnings
unconditionally.

With the fix
$ scripts/check-kernel-fix -F CVE-2025-37942
Security fix for CVE-2025-37942 bsc#1243576 with CVSS 4.7
= 1f650dcec32d ("HID: pidff: Make sure to fetch pool before checking SIMULTANEOUS_MAX") merged v6.15-rc1~171^2~5^2~10
No Fixes tag. Requires manual review for affected branches.
Experts candidates:  jkosina@suse.com (25) subsystem/role="Signed-off-by"
Link: https://git.kernel.org/linus/1f650dcec32d22deb1d6db12300a2b98483099a9
SLE12-SP3-TD: MANUAL: might need backport of 1f650dcec32d22deb1d6db12300a2b98483099a9 ()
SLE12-SP5: MANUAL: might need backport of 1f650dcec32d22deb1d6db12300a2b98483099a9 ()
SLE15-SP6: MANUAL: might need backport of 1f650dcec32d22deb1d6db12300a2b98483099a9 ()
ACTION NEEDED!

Potential git-fixes for 1f650dcec32d22deb1d6db12300a2b98483099a9
Nothing found

---

diff --git a/scripts/check-kernel-fix b/scripts/check-kernel-fix
index 368742c..839c45f 100755
--- a/scripts/check-kernel-fix
+++ b/scripts/check-kernel-fix
@@ -502,11 +502,13 @@ print_sha_action()
 
 	maybe_missing_commit)
 	    eligible_braches=$(($eligible_braches+1))
-	    if [ $warning_only_mode -eq 1 ]
+	    if has_warnings $branch $sha
 	    then
-		    has_warnings $branch $sha || return 0
+		    branches_with_warnings=$(($branches_with_warnings+1))
+	    elif [ $warning_only_mode -eq 1 ]
+	    then
+		    return
 	    fi
-	    branches_with_warnings=$(($branches_with_warnings+1))
 	    __print_action "$branch: MANUAL: might need backport of $sha ($references)"
 	    print_warnings $branch $sha
 	    ;;