]> git.proxmox.com Git - mirror_qemu.git/commitdiff
checkpatch: fix premature exit when no input or --mailback
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 29 Nov 2018 08:30:59 +0000 (09:30 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Jan 2019 12:57:23 +0000 (13:57 +0100)
In some cases, checkpatch's process subroutine is exiting the
whole process.  This is wrong, just return from the subroutine
instead.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/checkpatch.pl

index 18e16b79dfc81b503c0d54c2bc88807f38b9e3ea..66eb68e85a0e28f92c9edd5db64bfe097a00f8bb 100755 (executable)
@@ -2867,19 +2867,19 @@ sub process {
        # If we have no input at all, then there is nothing to report on
        # so just keep quiet.
        if ($#rawlines == -1) {
-               exit(0);
+               return 1;
        }
 
        # 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 are in 'no-patch' mode so
        # just keep quiet.
        if (!$chk_patch && !$is_patch) {
-               exit(0);
+               return 1;
        }
 
        if (!$is_patch) {