summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorBrian Pomerantz <bapper@gmail.com>2013-05-01 17:10:44 -0700
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-07-05 18:56:36 +0300
commit7e07518e542e653b67852a1c1d4f90fa914a0453 (patch)
treea0cfa69d586e616ec371e75f27a2a4559ab7fcb4 /drivers/mtd/ubi
parentb3743d58728192f99767c272371a1d80f974537a (diff)
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: Brian Pomerantz <bapper@gmail.com> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r--drivers/mtd/ubi/fastmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 0648c6996d43..154275182b4b 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -727,8 +727,10 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
aeb = NULL;
list_for_each_entry(tmp_aeb, &used, u.list) {
- if (tmp_aeb->pnum == pnum)
+ if (tmp_aeb->pnum == pnum) {
aeb = tmp_aeb;
+ break;
+ }
}
/* This can happen if a PEB is already in an EBA known