diff --git a/pmon/fs/ubifs/super.c b/pmon/fs/ubifs/super.c index 7781b14e..35339245 100644 --- a/pmon/fs/ubifs/super.c +++ b/pmon/fs/ubifs/super.c @@ -1184,7 +1184,10 @@ int ubifs_mount(char *vol_name) * First unmount if allready mounted */ if (ubifs_sb) + { ubifs_umount(ubifs_sb->s_fs_info); + ubifs_sb = NULL; + } INIT_LIST_HEAD(&ubifs_infos); INIT_LIST_HEAD(&ubifs_fs_type.fs_supers); diff --git a/pmon/fs/ubifs/ubifs.c b/pmon/fs/ubifs/ubifs.c index ef90ea4f..6de9868b 100644 --- a/pmon/fs/ubifs/ubifs.c +++ b/pmon/fs/ubifs/ubifs.c @@ -1126,6 +1126,7 @@ ubifs_open(int fd, const char *path, int flags, int mode) if(ubifs_mount(volname)) { puts("ubifs mounted failed!!"); + ubi_detach_mtd_dev(0, 1); return -1; } c = ubifs_sb->s_fs_info;