The patch titled Subject: checkpatch: fix krealloc reuse test has been added to the -mm tree. Its filename is checkpatch-fix-krealloc-reuse-test.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-fix-krealloc-reuse-test.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-fix-krealloc-reuse-test.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Joe Perches <joe@xxxxxxxxxxx> Subject: checkpatch: fix krealloc reuse test The current krealloc test does not function correctly when the temporary pointer return name contains the original pointer name. Fix that by maximally matching the return pointer name and the original pointer name and doing a separate comparison of the both names. Link: http://lkml.kernel.org/r/e617ecb8c019a9c4c56540a1bec16c8aed43a4e4.camel@xxxxxxxxxxx Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> Reported-by: Lars-Peter Clausen <lars@xxxxxxxxxx> Cc: Manish Narani <manish.narani@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN scripts/checkpatch.pl~checkpatch-fix-krealloc-reuse-test scripts/checkpatch.pl --- a/scripts/checkpatch.pl~checkpatch-fix-krealloc-reuse-test +++ a/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); } _ Patches currently in -mm which might be from joe@xxxxxxxxxxx are checkpatch-fix-krealloc-reuse-test.patch spdxcheck-work-with-current-head-licenses-directory.patch checkpatch-add-a-strict-test-for-structs-with-bool-member-definitions.patch checkpatch-add-fix-for-concatenated_string-and-string_fragments.patch checkpatch-improve-runtime-execution-speed-a-little.patch checkpatch-fix-macro-argument-reuse-test.patch checkpatch-validate-spdx-license-with-spdxcheckpy.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html