Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1361)

Unified Diff: firmware/lib/cgptlib/cgptlib.c

Issue 3315014: Successful partitions are never marked bad by cgptlib. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/cgptlib/cgptlib.c
diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c
index a7f8d4e849c87db9248c2341c6530f422283bf30..3213459a14cd3772d55c3e12249e6a447f8c6e14 100644
--- a/firmware/lib/cgptlib/cgptlib.c
+++ b/firmware/lib/cgptlib/cgptlib.c
@@ -129,10 +129,13 @@ int GptUpdateKernelEntry(GptData* gpt, uint32_t update_type) {
}
case GPT_UPDATE_ENTRY_BAD: {
/* Giving up on this partition entirely. */
- e->attrs.fields.gpt_att = previous_attr & ~(
- CGPT_ATTRIBUTE_SUCCESSFUL_MASK |
- CGPT_ATTRIBUTE_TRIES_MASK |
- CGPT_ATTRIBUTE_PRIORITY_MASK);
+ if (!GetEntrySuccessful(e)) {
+ /* Only clear tries and priority if the successful bit is not set. */
+ e->attrs.fields.gpt_att = previous_attr & ~(
+ CGPT_ATTRIBUTE_SUCCESSFUL_MASK |
Bill Richardson 2010/09/07 17:24:53 You don't need to explicitly clear the Attribute b
+ CGPT_ATTRIBUTE_TRIES_MASK |
+ CGPT_ATTRIBUTE_PRIORITY_MASK);
+ }
break;
}
default:
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698