Merge git://git.denx.de/u-boot-ubi
diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 90fb74a..33c176a 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1205,8 +1205,7 @@
 		}
 	}
 
-	if (ai->aeb_slab_cache)
-		kmem_cache_destroy(ai->aeb_slab_cache);
+	kmem_cache_destroy(ai->aeb_slab_cache);
 
 	kfree(ai);
 }
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 8f1c9d1..4465523 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -462,14 +462,10 @@
 		dbg_gen("cannot find next direntry, error %d", err);
 
 out_free:
-	if (file->private_data)
-		kfree(file->private_data);
-	if (file)
-		free(file);
-	if (dentry)
-		free(dentry);
-	if (dir)
-		free(dir);
+	kfree(file->private_data);
+	free(file);
+	free(dentry);
+	free(dir);
 
 	return ret;
 }