diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4523dd6d04765b4d386641fab034afc5d0836d24..d43a446941ce544d0ebbd9a750dcbb58fb0f08aa 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6167,7 +6167,8 @@ sub process { # check for krealloc arg reuse if ($perl_version_ok && - $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*\1\s*,/) { + $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*($Lval)\s*,/ && + $1 eq $3) { WARN("KREALLOC_ARG_REUSE", "Reusing the krealloc arg is almost always a bug\n" . $herecurr); }