mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Fredrik Gustafsson <iveqy@iveqy.com>
Cc: apw@canonical.com, linux-kernel@vger.kernel.org,
	Joe Perches <joe@perches.com>
Subject: Re: [PATCH] Prevent use of unitialized variable
Date: Wed, 6 Mar 2013 16:21:33 -0800	[thread overview]
Message-ID: <20130306162133.c2b3027c5cf75582d4f84869@linux-foundation.org> (raw)
In-Reply-To: <1362354169-13369-1-git-send-email-iveqy@iveqy.com>

On Mon,  4 Mar 2013 00:42:49 +0100 Fredrik Gustafsson <iveqy@iveqy.com> wrote:

> Run checkpatch.pl -f kernel/fork.c in commit
> ecf02a607bd801e742d7bb35c6e40f7ca15edf03
> and checkpatch.pl will try to use an uninitialized variable.
> This patch fixes that.
> 

This isn't a good description of the problem you're seeing. 
ecf02a607bd801e7 is a merge commit and I see no perl problems running
"perl scripts/checkpatch.pl -f kernel/fork.c" with my setup, so it's
pretty mysterious.

It is best to quote the full error output when fixing errors.

That things work OK for me isn't surprising, as these things are quite
dependent upon the perl version.

> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3363,14 +3363,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");
> +				}
>  			}
>  		}


  reply	other threads:[~2013-03-07  0:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-03 23:42 Fredrik Gustafsson
2013-03-07  0:21 ` Andrew Morton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-01-11  8:55 Fredrik Gustafsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130306162133.c2b3027c5cf75582d4f84869@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=iveqy@iveqy.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®