summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/fat/fat.c4
-rw-r--r--fs/fs_internal.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 7fe78439cf1..d16883fa10d 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -1149,11 +1149,13 @@ typedef struct {
int fat_opendir(const char *filename, struct fs_dir_stream **dirsp)
{
- fat_dir *dir = calloc(1, sizeof(*dir));
+ fat_dir *dir;
int ret;
+ dir = malloc_cache_aligned(sizeof(*dir));
if (!dir)
return -ENOMEM;
+ memset(dir, 0, sizeof(*dir));
ret = fat_itr_root(&dir->itr, &dir->fsdata);
if (ret)
diff --git a/fs/fs_internal.c b/fs/fs_internal.c
index 58b441030c8..5cdd272c9de 100644
--- a/fs/fs_internal.c
+++ b/fs/fs_internal.c
@@ -15,12 +15,13 @@ int fs_devread(struct blk_desc *blk, disk_partition_t *partition,
lbaint_t sector, int byte_offset, int byte_len, char *buf)
{
unsigned block_len;
- int log2blksz = blk->log2blksz;
+ int log2blksz;
ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, (blk ? blk->blksz : 0));
if (blk == NULL) {
printf("** Invalid Block Device Descriptor (NULL)\n");
return 0;
}
+ log2blksz = blk->log2blksz;
/* Check partition boundaries */
if ((sector + ((byte_offset + byte_len - 1) >> log2blksz))