Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f561e40b authored by Richard Weinberger's avatar Richard Weinberger Committed by Tatyana Brokhman
Browse files

UBI: Call scan_all() with correct offset in error case



If we find an invalid fastmap we have to scan from the very beginning.
Otherwise we leak the first 64 PEBs.

Change-Id: I7ded8ab07de9b21478bc284e7c2b655f9aa7707f
Reported-and-tested-by: default avatarRichard Genoud <richard.genoud@gmail.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Git-commit: 4b3e0a25aa5518892ec8dbfafdd6a57789aa0c22
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarTatyana Brokhman <tlinder@codeaurora.org>
parent 6248abb7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1417,11 +1417,13 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
				ai = alloc_ai("ubi_aeb_slab_cache2");
				if (!ai)
					return -ENOMEM;
			}

				err = scan_all(ubi, ai, 0);
			} else {
				err = scan_all(ubi, ai, UBI_FM_MAX_START);
			}
		}
	}
#else
	err = scan_all(ubi, ai, 0);
#endif