The patch titled Subject: checkpatch: prevent use of unitialized variable has been added to the -mm tree. Its filename is checkpatch-prevent-use-of-unitialized-variable.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/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Fredrik Gustafsson <iveqy@xxxxxxxxx> Subject: checkpatch: prevent use of unitialized variable Run checkpatch.pl -f kernel/fork.c in commit ecf02a607bd801e7 and checkpatch.pl will try to use an uninitialized variable. This patch fixes that. Signed-off-by: Fredrik Gustafsson <iveqy@xxxxxxxxx> Cc: Joe Perches <joe@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/checkpatch.pl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff -puN scripts/checkpatch.pl~checkpatch-prevent-use-of-unitialized-variable scripts/checkpatch.pl --- a/scripts/checkpatch.pl~checkpatch-prevent-use-of-unitialized-variable +++ a/scripts/checkpatch.pl @@ -3379,14 +3379,17 @@ sub process { my $ms_addr = $2; my $ms_val = $7; - my $ms_size = $12; - if ($ms_size =~ /^(0x|)0$/i) { - ERROR("MEMSET", - "memset to 0's uses 0 as the 2nd argument, not the 3rd\n" . "$here\n$stat\n"); - } elsif ($ms_size =~ /^(0x|)1$/i) { - WARN("MEMSET", - "single byte memset is suspicious. Swapped 2nd/3rd argument?\n" . "$here\n$stat\n"); + if (defined $12) { + my $ms_size = $12; + + if ($ms_size =~ /^(0x|)0$/i) { + ERROR("MEMSET", + "memset to 0's uses 0 as the 2nd argument, not the 3rd\n" . "$here\n$stat\n"); + } elsif ($ms_size =~ /^(0x|)1$/i) { + WARN("MEMSET", + "single byte memset is suspicious. Swapped 2nd/3rd argument?\n" . "$here\n$stat\n"); + } } } _ Patches currently in -mm which might be from iveqy@xxxxxxxxx are checkpatch-prevent-use-of-unitialized-variable.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