]> git.baikalelectronics.ru Git - kernel.git/commit
sbitmap: initialize weight to zero
authorColin Ian King <colin.king@canonical.com>
Mon, 19 Sep 2016 13:34:08 +0000 (14:34 +0100)
committerJens Axboe <axboe@fb.com>
Mon, 19 Sep 2016 14:19:40 +0000 (08:19 -0600)
commite9dc7637f962861267a6b7b6afc66d959677c0eb
tree8518edd7779ec1bec41d674f77956672edf37989
parente9370f5376f577ce46e4fbdab652312e5de69660
sbitmap: initialize weight to zero

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

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
lib/sbitmap.c