All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Colin King <colin.king@canonical.com>, linux-block@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sbitmap: initialize weight to zero
Date: Mon, 19 Sep 2016 08:20:45 -0600	[thread overview]
Message-ID: <cab7d4ae-3079-7add-d72b-1bdecf57e13d@kernel.dk> (raw)
In-Reply-To: <20160919133408.25559-1-colin.king@canonical.com>

On 09/19/2016 07:34 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable weight is not being initialized to zero before it is
> used to compute the weight sum. Ensure it is initialized to zero.
>
> Found with static analysis with cppcheck:
> [lib/sbitmap.c:177]: (error) Uninitialized variable: weight

Thanks, applied. Strange, this is an old issue, it was just moved to 
this file. It should have triggered on mainline too. My compiler doesn't 
complain here:

$ gcc --version
gcc (Ubuntu 6.2.0-3ubuntu11~16.04) 6.2.0 20160901

-- 
Jens Axboe

      reply	other threads:[~2016-09-19 14:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 13:34 [PATCH] sbitmap: initialize weight to zero Colin King
2016-09-19 14:20 ` Jens Axboe [this message]

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=cab7d4ae-3079-7add-d72b-1bdecf57e13d@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=colin.king@canonical.com \
    --cc=linux-block@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.