Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 116d4033 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "UBI: Fix memory leak in ubi_attach_fastmap() error path"

parents c98224ed 32cba237
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -841,6 +841,19 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
fail_bad:
	ret = UBI_BAD_FASTMAP;
fail:
	list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &used, u.list) {
		kmem_cache_free(ai->aeb_slab_cache, tmp_aeb);
		list_del(&tmp_aeb->u.list);
	}
	list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &eba_orphans, u.list) {
		kmem_cache_free(ai->aeb_slab_cache, tmp_aeb);
		list_del(&tmp_aeb->u.list);
	}
	list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list) {
		kmem_cache_free(ai->aeb_slab_cache, tmp_aeb);
		list_del(&tmp_aeb->u.list);
	}

	return ret;
}