Skip to content

Commit 584d462

Browse files
bapperdedekind
authored andcommitted
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 <[email protected]> Acked-by: Richard Weinberger <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]>
1 parent 95f9a4d commit 584d462

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mtd/ubi/fastmap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,10 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
727727

728728
aeb = NULL;
729729
list_for_each_entry(tmp_aeb, &used, u.list) {
730-
if (tmp_aeb->pnum == pnum)
730+
if (tmp_aeb->pnum == pnum) {
731731
aeb = tmp_aeb;
732+
break;
733+
}
732734
}
733735

734736
/* This can happen if a PEB is already in an EBA known

0 commit comments

Comments
 (0)