summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/fat/fat.c2
-rw-r--r--fs/fs.c7
2 files changed, 9 insertions, 0 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 4219801bde..8420f3a097 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -354,6 +354,8 @@ static int fat_stat(struct device_d *dev, const char *filename, struct stat *s)
FILINFO finfo;
int ret;
+ memset(&finfo, 0, sizeof(FILINFO));
+
ret = f_stat(&priv->fat, filename, &finfo);
if (ret)
return ret;
diff --git a/fs/fs.c b/fs/fs.c
index 56b822b6a0..13df71c923 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -743,6 +743,7 @@ int mount(const char *device, const char *fsname, const char *_path)
struct mtab_entry *entry;
struct fs_device_d *fsdev;
struct device_d *dev, *parent_device = NULL;
+ struct cdev *cdev = NULL;
int ret;
char *path = normalise_path(_path);
@@ -808,6 +809,12 @@ int mount(const char *device, const char *fsname, const char *_path)
goto out2;
}
+ if (!strncmp(device, "/dev/", 5)) {
+ cdev = cdev_by_name(device + 5);
+ if(cdev)
+ parent_device = cdev->dev;
+ }
+
if (parent_device)
dev_add_child(parent_device, &fsdev->dev);