Skip to content

Commit f16db80

Browse files
UBI: initialize LEB number variable
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>
1 parent d74adbd commit f16db80

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
@@ -1002,7 +1002,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
10021002
int shutdown)
10031003
{
10041004
int err, scrubbing = 0, torture = 0, protect = 0, erroneous = 0;
1005-
int vol_id = -1, uninitialized_var(lnum);
1005+
int vol_id = -1, lnum = -1;
10061006
#ifdef CONFIG_MTD_UBI_FASTMAP
10071007
int anchor = wrk->anchor;
10081008
#endif

0 commit comments

Comments
 (0)