Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bd
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@users.noreply.github.com>2021-11-14 18:10:54 +0300
committerGitHub <noreply@github.com>2021-11-14 18:10:54 +0300
commitfdda3b4aa2a30698f8bccf47e794ffa7eda67239 (patch)
tree1abdb7e5d249fde745cb0435584653bab0a27326 /bd
parentead50807f1ca3fdf2da00b77a0ce02651ded2d13 (diff)
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.
Diffstat (limited to 'bd')
-rw-r--r--bd/lfs_rambd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bd/lfs_rambd.c b/bd/lfs_rambd.c
index 0a6b5cc..beb0267 100644
--- a/bd/lfs_rambd.c
+++ b/bd/lfs_rambd.c
@@ -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);