mtd: fix some unallocated and NULL pointer issues. rwb->wrflush and rwb->wrmaxblocks in rwbuffer could get unallocated values from ftl_initialize() in some configurations. Also fixes related assert:

up_assert: Assertion failed at file:rwbuffer.c line: 643

that can happen with the following configuration:

  CONFIG_FTL_WRITEBUFFER=y
  CONFIG_DRVR_WRITEBUFFER=y
  # CONFIG_FS_WRITABLE is not set

These problems are caused by CONFIG variable differences between the buffer layers. TODO: This is not a perfect solution. readahead support has similar issues.
This commit is contained in:
Juha Niskanen
2017-05-11 07:22:21 -06:00
committed by Gregory Nutt
parent 58a0b09b82
commit 0f7210b0ae
3 changed files with 45 additions and 37 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ config MTD_PARTITION
config FTL_WRITEBUFFER
bool "Enable write buffering in the FTL layer"
default n
depends on DRVR_WRITEBUFFER
depends on DRVR_WRITEBUFFER && FS_WRITABLE
config FTL_READAHEAD
bool "Enable read-ahead buffering in the FTL layer"