summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/wl.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2013-04-08 10:32:46 +0000
committerTom Rini <trini@ti.com>2013-04-11 15:52:54 -0400
commit76c1637e95f738add192aa6d338c2f90a981d661 (patch)
tree931cf42afcac460d93f06e6654ce460db9334006 /drivers/mtd/ubi/wl.c
parent3d38910151e3d069a164190763c7b03d11f1eec4 (diff)
downloadblackbird-obmc-uboot-76c1637e95f738add192aa6d338c2f90a981d661.tar.gz
blackbird-obmc-uboot-76c1637e95f738add192aa6d338c2f90a981d661.zip
ubi: Fix broken cleanup code in attach_by_scanning
The unwind code was not reversing operations correctly and was causing a hang on any error condition. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/mtd/ubi/wl.c')
-rw-r--r--drivers/mtd/ubi/wl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 88b867a0c1..d1ba722cb5 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -1538,6 +1538,7 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si)
if (ubi->avail_pebs < WL_RESERVED_PEBS) {
ubi_err("no enough physical eraseblocks (%d, need %d)",
ubi->avail_pebs, WL_RESERVED_PEBS);
+ err = -ENOSPC;
goto out_free;
}
ubi->avail_pebs -= WL_RESERVED_PEBS;
OpenPOWER on IntegriCloud