linux-6.16/fs/jffs2/readinode.c:189: loop can never finish

David Oberhollenzer david.oberhollenzer at sigma-star.at
Mon Aug 4 00:30:32 PDT 2025


Hi,

On 8/4/25 9:10 AM, Zhihao Cheng wrote:
> 
> The 'next != NULL' is also a condition for the loop, this snippet of code finds a leaf node in 'tn_root'.

Yes, this is a classic tree traversal. Assuming the tree isn't
broken, the loop eventually terminates when it runs of a leaf.

The real issue with this code is that this is the *only* exit
condition of the loop. The traversal loop always branches until
it hits a leaf and the function then returns NULL. I'm pretty
sure this might not be the intended behavior.

Greetings,

David




More information about the linux-mtd mailing list