UBI: fastmap break out of used PEB search
authorBrian Pomerantz <bapper@gmail.com>
Thu, 2 May 2013 00:10:44 +0000 (17:10 -0700)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 29 May 2013 13:49:02 +0000 (16:49 +0300)
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>
drivers/mtd/ubi/fastmap.c

index 0648c6996d43a94031d135163d4a693132dcc2b4..154275182b4b22d8943e4be1ba6d5eb119694e3a 100644 (file)
@@ -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
This page took 0.025094 seconds and 5 git commands to generate.