summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/ubi/build.c12
-rw-r--r--fs/ubifs/super.c6
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 3ea0e6c..d144ac2 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -476,21 +476,21 @@ static int attach_by_scanning(struct ubi_device *ubi)
if (err)
goto out_si;
- err = ubi_wl_init_scan(ubi, si);
- if (err)
- goto out_vtbl;
-
err = ubi_eba_init_scan(ubi, si);
if (err)
goto out_wl;
+ err = ubi_wl_init_scan(ubi, si);
+ if (err)
+ goto out_vtbl;
+
ubi_scan_destroy_si(si);
return 0;
-out_wl:
- ubi_wl_close(ubi);
out_vtbl:
vfree(ubi->vtbl);
+out_wl:
+ ubi_wl_close(ubi);
out_si:
ubi_scan_destroy_si(si);
return err;
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 63b2164..26b48f0 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -848,8 +848,10 @@ void ubifs_umount(struct ubifs_info *c)
ubifs_debugging_exit(c);
/* Finally free U-Boot's global copy of superblock */
- free(ubifs_sb->s_fs_info);
- free(ubifs_sb);
+ if (ubifs_sb != NULL) {
+ free(ubifs_sb->s_fs_info);
+ free(ubifs_sb);
+ }
}
/**