@@ -515,13 +515,12 @@ int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs)
out_acc:
spin_lock(&ubi->volumes_lock);
vol->reserved_pebs = reserved_pebs - pebs;
- if (pebs > 0) {
- ubi->rsvd_pebs -= pebs;
- ubi->avail_pebs += pebs;
+ ubi->rsvd_pebs -= pebs;
+ ubi->avail_pebs += pebs;
+ if (pebs > 0)
ubi_eba_copy_table(vol, old_eba_tbl, vol->reserved_pebs);
- } else {
+ else
ubi_eba_copy_table(vol, old_eba_tbl, reserved_pebs);
- }
vol->eba_tbl = old_eba_tbl;
spin_unlock(&ubi->volumes_lock);
out_free: