As phys was being overloaded slightly, this was broken.
Signed-off-by: NeilBrown <neilb@suse.de>
* Entries are 10 bytes: 6 byte dev address, 4 byte file address.
*/
char *buf = *bufp;
+ int found_end = 0;
handle(data, addr, 0); /* initialise */
- while (len >= 10 || uninc != NULL) {
+ while ((len >= 10 && !found_end) || uninc != NULL) {
unsigned long addr = 0;
u64 phys = 0;
phys = decode48(buf);
addr = decode32(buf);
len -= 10;
+ if (phys == 0)
+ found_end = 1;
}
while (uninc &&
*bufp = buf - 10;
return 0;
}
- if (phys == 0 && uninc == NULL)
- break;
}
handle(data, 0, ~(u64)0); /* finalise */
return 1;