diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2013-04-08 10:32:46 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-04-11 15:52:54 -0400 |
commit | 76c1637e95f738add192aa6d338c2f90a981d661 (patch) | |
tree | 931cf42afcac460d93f06e6654ce460db9334006 /drivers/mtd/ubi/build.c | |
parent | 3d38910151e3d069a164190763c7b03d11f1eec4 (diff) |
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/build.c')
-rw-r--r-- | drivers/mtd/ubi/build.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index d144ac29bc..a708162e43 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -478,19 +478,19 @@ static int attach_by_scanning(struct ubi_device *ubi) err = ubi_eba_init_scan(ubi, si); if (err) - goto out_wl; + goto out_vtbl; err = ubi_wl_init_scan(ubi, si); if (err) - goto out_vtbl; + goto out_eba; ubi_scan_destroy_si(si); return 0; +out_eba: + ubi_eba_close(ubi); out_vtbl: vfree(ubi->vtbl); -out_wl: - ubi_wl_close(ubi); out_si: ubi_scan_destroy_si(si); return err; |