Skip to content

Commit

Permalink
Always zero rambd buffer before first use
Browse files Browse the repository at this point in the history
This fixes warnings produced by tools such as memcheck without
requiring the user to set an erase value.
  • Loading branch information
tniessen authored Nov 14, 2021
1 parent ead5080 commit fdda3b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bd/lfs_rambd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fdda3b4

Please sign in to comment.