-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs/fcb2: fix endless loop in fcb2_getprev if a flash error occurs #2949
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ fcb2_sector_find_last(struct fcb2 *fcb, struct fcb2_entry *loc) | |
if (rc == 0) { | ||
last_valid = loc->fe_entry_num; | ||
} | ||
if (rc == FCB2_ERR_NOVAR) { | ||
else if (rc == FCB2_ERR_NOVAR) { | ||
/* | ||
* Out entries in this sector | ||
*/ | ||
|
@@ -52,7 +52,7 @@ fcb2_sector_find_last(struct fcb2 *fcb, struct fcb2_entry *loc) | |
} | ||
} | ||
loc->fe_entry_num++; | ||
} while (1); | ||
} while (rc == 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Endless loop was supposed to handle cases where FCB2 had corrupted entries (most likely CRC for broken writes). |
||
return rc; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else should be in previous line to keep coding style presistant