UBI: return ENOSPC if no enough space available
[firefly-linux-kernel-4.4.55.git] / drivers / mtd / ubi / wl.c
index c08254016fe8b34d495793de03ffdd589e894a00..3375bfb1b24679588d29c0fc9b8baf3ddf2fca0d 100644 (file)
@@ -1978,6 +1978,7 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
                if (ubi->corr_peb_count)
                        ubi_err("%d PEBs are corrupted and not used",
                                ubi->corr_peb_count);
+               err = -ENOSPC;
                goto out_free;
        }
        ubi->avail_pebs -= reserved_pebs;