From: Dan Carpenter Date: Thu, 28 Feb 2019 05:35:51 +0000 (+0300) Subject: ubi: wl: Silence uninitialized variable warning X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5578e48e5c0bf4684e68ae08caa2293bfb3f5307;p=linux.git 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: 663586c0a892 ("ubi: Expose the bitrot interface") Signed-off-by: Dan Carpenter Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Richard Weinberger --- diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 40f838d54b0fd..2709dc02fc249 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -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. */