Skip to content

Commit 5578e48

Browse files
Dan Carpenterrichardweinberger
authored andcommitted
ubi: wl: Silence uninitialized variable warning
This condition needs to be fipped around because "err" is uninitialized when "force" is set. The Smatch static analysis tool complains and UBsan will also complain at runtime. Fixes: 663586c ("ubi: Expose the bitrot interface") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Tested-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 2fe8b2d commit 5578e48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/ubi/wl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ int ubi_bitflip_check(struct ubi_device *ubi, int pnum, int force)
15171517
mutex_unlock(&ubi->buf_mutex);
15181518
}
15191519

1520-
if (err == UBI_IO_BITFLIPS || force) {
1520+
if (force || err == UBI_IO_BITFLIPS) {
15211521
/*
15221522
* Okay, bit flip happened, let's figure out what we can do.
15231523
*/

0 commit comments

Comments
 (0)