Skip to content

Commit 256f346

Browse files
computersforpeacesashalevin
authored andcommitted
UBI: initialize LEB number variable
[ Upstream commit f16db80 ] In some of the 'out_not_moved' error paths, lnum may be used uninitialized. Don't ignore the warning; let's fix it. This uninitialized variable doesn't have much visible effect in the end, since we just schedule the PEB for erasure, and its LEB number doesn't really matter (it just gets printed in debug messages). But let's get it straight anyway. Coverity CID #113449 Cc: stable <stable@vger.kernel.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 parent c2ffa09 commit 256f346

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/mtd/ubi/wl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
10011001
int shutdown)
10021002
{
10031003
int err, scrubbing = 0, torture = 0, protect = 0, erroneous = 0;
1004-
int vol_id = -1, uninitialized_var(lnum);
1004+
int vol_id = -1, lnum = -1;
10051005
#ifdef CONFIG_MTD_UBI_FASTMAP
10061006
int anchor = wrk->anchor;
10071007
#endif

0 commit comments

Comments
 (0)