When the value of lp is 0 at the beginning of the for loop, it will
become negative in the next assignment and we should bail out.
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=412dea214d8baa3f7483
Tested-by: [email protected]
Signed-off-by: Nihar Chaithanya <[email protected]>
Signed-off-by: Dave Kleikamp <[email protected]>
/* bubble the new value up the tree as required.
*/
for (k = 0; k < le32_to_cpu(tp->dmt_height); k++) {
+ if (lp == 0)
+ break;
+
/* get the index of the first leaf of the 4 leaf
* group containing the specified leaf (leafno).
*/