When the last hunk of a patch is short it will trigger errors from checkpatch: Use of uninitialized value in pattern match (m//) at /usr/local/bin/checkpatch.pl line 394. Use of uninitialized value in concatenation (.) or string at /usr/local/bin/checkpatch.pl line 397. Use of uninitialized value in pattern match (m//) Avoid touching beyond the last line. Reported by Julien Brunel.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -408,6 +408,7 @@ sub ctx_statement_block { · 407 unmodified lines | |||
| 408 | # context. | 408 | # context. |
| 409 | if ($off >= $len) { | 409 | if ($off >= $len) { |
| 410 | for (; $remain > 0; $line++) { | 410 | for (; $remain > 0; $line++) { |
| 411 | last if (!defined $lines[$line]); | ||
| 411 | next if ($lines[$line] =~ /^-/); | 412 | next if ($lines[$line] =~ /^-/); |
| 412 | $remain--; | 413 | $remain--; |
| 413 | $loff = $len; | 414 | $loff = $len; |