lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 11 Nov 2023 22:33:14 +0800
From:   Kunwu Chan <chentao@...inos.cn>
To:     richard@....at, Artem.Bityutskiy@...ia.com
Cc:     kunwu.chan@...mail.com, linux-mtd@...ts.infradead.org,
        linux-kernel@...r.kernel.org, Kunwu Chan <chentao@...inos.cn>
Subject: [PATCH] ubifs: Remove unreachable code

Because there is no break statement in the dead loop above,it is
impossible to execute the 'err=0' statement.Delete the code that
will never execute and initialize 'err' at the start of the function.

Fixes: 6fb324a4b0c3 ("UBIFS: allocate ltab checking buffer on demand")
Signed-off-by: Kunwu Chan <chentao@...inos.cn>
---
 fs/ubifs/lpt_commit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c
index c4d079328b92..d4751628fe70 100644
--- a/fs/ubifs/lpt_commit.c
+++ b/fs/ubifs/lpt_commit.c
@@ -1589,8 +1589,8 @@ static int dbg_is_node_dirty(struct ubifs_info *c, int node_type, int lnum,
  */
 static int dbg_check_ltab_lnum(struct ubifs_info *c, int lnum)
 {
-	int err, len = c->leb_size, dirty = 0, node_type, node_num, node_len;
-	int ret;
+	int len = c->leb_size, dirty = 0, node_type, node_num, node_len;
+	int ret, err = 0;
 	void *buf, *p;
 
 	if (!dbg_is_chk_lprops(c))
@@ -1646,7 +1646,6 @@ static int dbg_check_ltab_lnum(struct ubifs_info *c, int lnum)
 		len -= node_len;
 	}
 
-	err = 0;
 out:
 	vfree(buf);
 	return err;
-- 
2.34.1

Powered by blists - more mailing lists