[PATCH 1/4] checkpatch: don't stop at the first clean patch with --mailback
From: Bjorn Andersson
Date: Sat Nov 07 2026 - 23:23:19 EST
When checkpatch is given multiple patches, either as several files or
as a --git range, --mailback causes process() to call exit(0) as soon
as it encounters a clean patch. The remaining patches are never
checked, and the run is reported as successful even if later patches
contain errors or warnings.
E.g. with a clean patch followed by a patch with a bogus Fixes: tag:
$ ./scripts/checkpatch.pl -q --terse --mailback clean.patch bad.patch
$ echo $?
0
Return from process() instead, so the clean patch is still silently
accepted while the remaining patches are checked.
Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxxxx>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 741b189d5e01..e84bb4c12eb4 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -7880,7 +7880,7 @@ sub process {
# In mailback mode only produce a report in the negative, for
# things that appear to be patches.
if ($mailback && ($clean == 1 || !$is_patch)) {
- exit(0);
+ return 1;
}
# This is not a patch, and we are in 'no-patch' mode so
--
2.55.0