Commit 584d4623 authored by Brian Pomerantz's avatar Brian Pomerantz Committed by Artem Bityutskiy

UBI: fastmap break out of used PEB search

While searching for PEB matches for each volume in the used PEB list,
the search fails to stop when the PEB is found.  This patch adds
a break in the inner loop to stop the search when it is matched.
Signed-off-by: default avatarBrian Pomerantz <bapper@gmail.com>
Acked-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent 95f9a4d2
...@@ -727,8 +727,10 @@ static int ubi_attach_fastmap(struct ubi_device *ubi, ...@@ -727,8 +727,10 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
aeb = NULL; aeb = NULL;
list_for_each_entry(tmp_aeb, &used, u.list) { list_for_each_entry(tmp_aeb, &used, u.list) {
if (tmp_aeb->pnum == pnum) if (tmp_aeb->pnum == pnum) {
aeb = tmp_aeb; aeb = tmp_aeb;
break;
}
} }
/* This can happen if a PEB is already in an EBA known /* This can happen if a PEB is already in an EBA known
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment