aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/checkpatch.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4de4bc48493b..a820249a3fce 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3477,6 +3477,13 @@ sub process {
3477 "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); 3477 "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
3478 } 3478 }
3479 3479
3480# check for krealloc arg reuse
3481 if ($^V && $^V ge 5.10.0 &&
3482 $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*\1\s*,/) {
3483 WARN("KREALLOC_ARG_REUSE",
3484 "Reusing the krealloc arg is almost always a bug\n" . $herecurr);
3485 }
3486
3480# check for alloc argument mismatch 3487# check for alloc argument mismatch
3481 if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) { 3488 if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) {
3482 WARN("ALLOC_ARRAY_ARGS", 3489 WARN("ALLOC_ARRAY_ARGS",