diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index 7b7add6da12f31aeac6fab06299e6167e981f46a..1297732f4db95c4275e9f3f78b81345d48787572 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c @@ -1188,6 +1188,7 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si) if (ubi->avail_pebs < EBA_RESERVED_PEBS) { ubi_err("no enough physical eraseblocks (%d, need %d)", ubi->avail_pebs, EBA_RESERVED_PEBS); + err = -ENOSPC; goto out_free; } ubi->avail_pebs -= EBA_RESERVED_PEBS;