[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID:
<AS8PR02MB10217F68E5D37ECD491495E669C23A@AS8PR02MB10217.eurprd02.prod.outlook.com>
Date: Mon, 4 Aug 2025 06:23:36 +0000
From: David Binderman <dcb314@...mail.com>
To: "dwmw2@...radead.org" <dwmw2@...radead.org>, "richard@....at"
<richard@....at>, "linux-mtd@...ts.infradead.org"
<linux-mtd@...ts.infradead.org>, Linux Kernel Mailing List
<linux-kernel@...r.kernel.org>
Subject: linux-6.16/fs/jffs2/readinode.c:189: loop can never finish
Hello there,
Static analyser cppcheck said:
linux-6.16/fs/jffs2/readinode.c:189:24: style: Expression is always true because 'else if' condition is opposite to previous condition at line 187. [multiCondition]
Source code is
while (next) {
tn = rb_entry(next, struct jffs2_tmp_dnode_info, rb);
if (tn->fn->ofs < offset)
next = tn->rb.rb_right;
else if (tn->fn->ofs >= offset)
next = tn->rb.rb_left;
else
break;
}
It looks to me like this loop will never finish.
Suggest change ">=" to ">".
Regards
David Binderman
Powered by blists - more mailing lists