提交 5578e48e 编写于 作者: D Dan Carpenter 提交者: Richard Weinberger

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: 663586c0 ("ubi: Expose the bitrot interface")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NNathan Chancellor <natechancellor@gmail.com>
Tested-by: NNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: NRichard Weinberger <richard@nod.at>
上级 2fe8b2d5
......@@ -1517,7 +1517,7 @@ int ubi_bitflip_check(struct ubi_device *ubi, int pnum, int force)
mutex_unlock(&ubi->buf_mutex);
}
if (err == UBI_IO_BITFLIPS || force) {
if (force || err == UBI_IO_BITFLIPS) {
/*
* Okay, bit flip happened, let's figure out what we can do.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册