]> git.sur5r.net Git - u-boot/blobdiff - fs/ubifs/super.c
mmc:sdhci:fix: Change default interrupts enabled at SDHCI initialization
[u-boot] / fs / ubifs / super.c
index 39e3efec802d6929ac914ec88d10afa720e74d47..30ccd98c22b3942bbb2a909a18d0ff3516953260 100644 (file)
@@ -824,7 +824,7 @@ out_free:
  * through mounting (error path cleanup function). So it has to make sure the
  * resource was actually allocated before freeing it.
  */
-static void ubifs_umount(struct ubifs_info *c)
+void ubifs_umount(struct ubifs_info *c)
 {
        dbg_gen("un-mounting UBI device %d, volume %d", c->vi.ubi_num,
                c->vi.vol_id);
@@ -848,8 +848,10 @@ static 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);
+       }
 }
 
 /**
@@ -1189,7 +1191,7 @@ int ubifs_mount(char *vol_name)
        mnt = NULL;
        ret = ubifs_get_sb(&ubifs_fs_type, flags, name, data, mnt);
        if (ret) {
-               printf("Error reading superblock on volume '%s'!\n", name);
+               ubifs_err("Error reading superblock on volume '%s' errno=%d!\n", name, ret);
                return -1;
        }