Always zero rambd buffer before first use
This fixes warnings produced by tools such as memcheck without requiring the user to set an erase value.
This commit is contained in:
@@ -36,6 +36,8 @@ int lfs_rambd_createcfg(const struct lfs_config *cfg,
|
||||
if (bd->cfg->erase_value != -1) {
|
||||
memset(bd->buffer, bd->cfg->erase_value,
|
||||
cfg->block_size * cfg->block_count);
|
||||
} else {
|
||||
memset(bd->buffer, 0, cfg->block_size * cfg->block_count);
|
||||
}
|
||||
|
||||
LFS_RAMBD_TRACE("lfs_rambd_createcfg -> %d", 0);
|
||||
|
||||
Reference in New Issue
Block a user