]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - fs/ubifs/super.c
mtd: nand: kirkwood: add RS-ECC encoding support
[karo-tx-uboot.git] / fs / ubifs / super.c
index 39e3efec802d6929ac914ec88d10afa720e74d47..26b48f029e76a032e0c3deb1445d34d1d921c4f5 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);
+       }
 }
 
 /**