Skip to content

Commit

Permalink
flashfs32: fix result handling (#24371)
Browse files Browse the repository at this point in the history
We need to translate return values here, otherwise this complains being
unsuccessful when it was actually ok.
  • Loading branch information
julianoes authored Mar 1, 2025
1 parent b5f37c9 commit d4509a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/parameters/flashparams/flashfs32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,11 @@ int parameter_flashfs_init(sector_descriptor_t *fconfig, uint8_t *buffer, uint16
if (pf == NULL) {
// Parameters can't be found, assume sector is corrupt or empty
rv = parameter_flashfs_erase();

// A positive return value means flash space has been erased successfully.
if (rv > 0) {
rv = 0;
}
}

return rv;
Expand Down

0 comments on commit d4509a6

Please sign in to comment.