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

Commit 21d08bbc authored by Artem Bityutskiy's avatar Artem Bityutskiy
Browse files

UBI: fix kmem_cache_free on error patch



'kmem_cache_free()' oopeses if NULL is passed, and there is
one error-path place where UBI may call it with NULL object.
This problem was pointed to by Adrian Hunter.

Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 52b605d1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -826,6 +826,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
	err = schedule_erase(ubi, e1, 0);
	if (err) {
		kmem_cache_free(ubi_wl_entry_slab, e1);
		if (e2)
			kmem_cache_free(ubi_wl_entry_slab, e2);
		goto out_ro;
	}