summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-14 08:26:40 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-21 16:14:57 +0100
commitad3a744ac4e52deb0202c0b28d32e1077a260630 (patch)
treedd4029d05c7e28381dda97398cd9b308396479c3 /cpukit
parent201f3797b32033fc23c6448fe8f04c4e16344588 (diff)
downloadrtems-ad3a744ac4e52deb0202c0b28d32e1077a260630.tar.bz2
dosfs: Simplify fat_file_open()
Update #2929.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libfs/src/dosfs/fat_file.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/cpukit/libfs/src/dosfs/fat_file.c b/cpukit/libfs/src/dosfs/fat_file.c
index cbc0ab3b78..c65c758214 100644
--- a/cpukit/libfs/src/dosfs/fat_file.c
+++ b/cpukit/libfs/src/dosfs/fat_file.c
@@ -110,12 +110,10 @@ fat_file_open(
/* access "removed-but-still-open" hash table */
rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd);
- lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t));
+ lfat_fd = (*fat_fd) = (fat_file_fd_t*)calloc(1, sizeof(fat_file_fd_t));
if ( lfat_fd == NULL )
rtems_set_errno_and_return_minus_one( ENOMEM );
- memset(lfat_fd, 0, sizeof(fat_file_fd_t));
-
lfat_fd->links_num = 1;
lfat_fd->flags &= ~FAT_FILE_REMOVED;
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;