From: Dan Carpenter <dan.carpen...@oracle.com>

Move the kmem_cache_free() calls down a couple lines.

Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>
Signed-off-by: Artem Bityutskiy <artem.bityuts...@linux.intel.com>
---
 drivers/mtd/ubi/fastmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index de68c32..50db661 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -462,8 +462,8 @@ static int scan_pool(struct ubi_device *ubi, struct 
ubi_attach_info *ai,
                                }
                        }
                        if (found_orphan) {
-                               kfree(tmp_aeb);
                                list_del(&tmp_aeb->u.list);
+                               kfree(tmp_aeb);
                        }
 
                        new_aeb = kzalloc(sizeof(*new_aeb), GFP_KERNEL);
@@ -835,16 +835,16 @@ fail_bad:
        ret = UBI_BAD_FASTMAP;
 fail:
        list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &used, u.list) {
-               free(tmp_aeb);
                list_del(&tmp_aeb->u.list);
+               free(tmp_aeb);
        }
        list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &eba_orphans, u.list) {
-               free(tmp_aeb);
                list_del(&tmp_aeb->u.list);
+               free(tmp_aeb);
        }
        list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &lfree, u.list) {
-               free(tmp_aeb);
                list_del(&tmp_aeb->u.list);
+               free(tmp_aeb);
        }
 
        return ret;
-- 
2.1.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to