summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorƁukasz Majewski <l.majewski@samsung.com>2012-12-05 08:06:40 +0000
committerTom Rini <trini@ti.com>2012-12-07 08:47:53 -0700
commit13d43555a9154cf12255023c47e80d947d7d0604 (patch)
tree87c0164ebdca3110238832c7b6010d69c469a4be
parentd429ca0d831024b1b1845db8a5e950b44e10db04 (diff)
downloadu-boot-imx-13d43555a9154cf12255023c47e80d947d7d0604.zip
u-boot-imx-13d43555a9154cf12255023c47e80d947d7d0604.tar.gz
u-boot-imx-13d43555a9154cf12255023c47e80d947d7d0604.tar.bz2
fs:ext4:write: Initialize cache aligned filename buffer
The filename buffer is allocated dynamically. It must be cache aligned. Moreover, it is necessary to erase its content before we use it for file name operations. This prevents from corruption of written file names. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-rw-r--r--fs/ext4/ext4fs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c
index 64d8a6d..f02c215 100644
--- a/fs/ext4/ext4fs.c
+++ b/fs/ext4/ext4fs.c
@@ -1011,8 +1011,6 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
unsigned int blks_reqd_for_file;
unsigned int blocks_remaining;
int existing_file_inodeno;
- char filename[256];
-
char *temp_ptr = NULL;
long int itable_blkno;
long int parent_itable_blkno;
@@ -1021,6 +1019,9 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
unsigned int inodes_per_block;
unsigned int ibmap_idx;
struct ext_filesystem *fs = get_fs();
+ ALLOC_CACHE_ALIGN_BUFFER(char, filename, 256);
+ memset(filename, 0x00, sizeof(filename));
+
g_parent_inode = zalloc(sizeof(struct ext2_inode));
if (!g_parent_inode)
goto fail;