summaryrefslogtreecommitdiff
path: root/firmware/common/dir_uncached.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/dir_uncached.c')
-rw-r--r--firmware/common/dir_uncached.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/firmware/common/dir_uncached.c b/firmware/common/dir_uncached.c
index 2052503..c6f3a6f 100644
--- a/firmware/common/dir_uncached.c
+++ b/firmware/common/dir_uncached.c
@@ -114,11 +114,16 @@ DIR_UNCACHED* opendir_uncached(const char* name)
}
if ( (entry.attr & FAT_ATTR_DIRECTORY) &&
(!strcasecmp(part, entry.name)) ) {
- pdir->parent_dir = pdir->fatdir;
+ /* in reality, the parent_dir parameter of fat_opendir is
+ * useless because it's sole purpose it to have a way to
+ * update the file metadata, but here we are only reading
+ * a directory so there's no need for that kind of stuff.
+ * Consequently, we can safely pass NULL of it because
+ * fat_opendir and fat_open are NULL-protected. */
if ( fat_opendir(IF_MV2(volume,)
&pdir->fatdir,
entry.firstcluster,
- &pdir->parent_dir) < 0 ) {
+ NULL) < 0 ) {
DEBUGF("Failed opening dir '%s' (%ld)\n",
part, entry.firstcluster);
pdir->busy = false;