UBI: return ENOSPC if no enough space available
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / mtd / ubi / vtbl.c
index d77b1c1d7c7267c3186635497eeba492f539d735..bebf49e0dbe90cc95f820b1d1ce4177ed7de810e 100644 (file)
@@ -651,6 +651,7 @@ static int init_volumes(struct ubi_device *ubi,
                if (ubi->corr_peb_count)
                        ubi_err("%d PEBs are corrupted and not used",
                                ubi->corr_peb_count);
+               return -ENOSPC;
        }
        ubi->rsvd_pebs += reserved_pebs;
        ubi->avail_pebs -= reserved_pebs;