Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1486538

Re: [PATCH] sbitmap: initialize weight to zero

From Jens Axboe <axboe@kernel.dk>
Newsgroups linux.kernel
Subject Re: [PATCH] sbitmap: initialize weight to zero
Date 2016-09-19 16:30 +0200
Message-ID <sj7K1-6ya-9@gated-at.bofh.it> (permalink)
References <sj6XD-62j-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] sbitmap: initialize weight to zero Colin King <colin.king@canonical.com> - 2016-09-19 15:40 +0200
  Re: [PATCH] sbitmap: initialize weight to zero Jens Axboe <axboe@kernel.dk> - 2016-09-19 16:30 +0200

csiph-web