diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-08-10 08:19:57 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-08-10 08:21:46 +0200 |
commit | 90245ebc5328b998d24b0ab9f6a91496036c3202 (patch) | |
tree | b010bae68c68e929bed8ddddd78a045ace7eea21 /fs/ramfs.c | |
parent | 8b8dcd3ea6b1fa82be3092ae70750258f1bfaca6 (diff) | |
download | barebox-90245ebc5328b998d24b0ab9f6a91496036c3202.tar.gz barebox-90245ebc5328b998d24b0ab9f6a91496036c3202.tar.xz |
fs: ramfs: get chunks zero initialized
Initialize new chunks to zero, otherwise a ->truncate call may
result in uninitialized data in files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/ramfs.c')
-rw-r--r-- | fs/ramfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ramfs.c b/fs/ramfs.c index a97f0a6ebf..7af885b324 100644 --- a/fs/ramfs.c +++ b/fs/ramfs.c @@ -140,7 +140,7 @@ static struct ramfs_chunk *ramfs_get_chunk(void) if (!data) return NULL; - data->data = malloc(CHUNK_SIZE); + data->data = calloc(CHUNK_SIZE, 1); if (!data->data) { free(data); return NULL; |