xhh233 opened a new issue, #22316: URL: https://github.com/apache/nuttx/issues/22316
**Mechanism.** The consolidation helper returns `0` as its **failure sentinel**. `SET` ignores that value, retries the free-entry search, and can end up returning `-ENOMEM` even though the real failure was an I/O error during consolidation. **Effect.** The caller sees a misleading `-ENOMEM` (or an apparently successful retry) instead of the underlying I/O failure, and the diagnostic information from the original error is lost. **Location.** `drivers/mtd/mtd_config.c:730-733`, `:1000-1003`, `:1313`, `:1328` (master `f284e6d7`). **Trigger.** A consolidation pass during `SET` hits an MTD write/erase error. **Expected.** The original I/O error reaches the caller. **Evidence.** Source inspection only: both error returns yield `0`, and both call sites discard the return value. **Patch.** Return the underlying error from the consolidation helper and propagate it from `SET`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
