From c4ca6be9d67eaf5a53054903530c8f422b4b88bd Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Mon, 6 Oct 2014 14:47:51 +0200 Subject: UBI: Fastmap: Don't allocate new ubi_wl_entry objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no need to allocate new ones every time, we can reuse the existing ones. This makes the code cleaner and more easy to follow. Signed-off-by: Richard Weinberger Reviewed-by: Tanya Brokhman Reviewed-by: Guido Martínez --- drivers/mtd/ubi/wl.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/mtd/ubi/wl.c') diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 227ca641f700..34a8ec44cc59 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -1011,9 +1011,6 @@ int ubi_wl_put_fm_peb(struct ubi_device *ubi, struct ubi_wl_entry *fm_e, e = fm_e; ubi_assert(e->ec >= 0); ubi->lookuptbl[pnum] = e; - } else { - e->ec = fm_e->ec; - kfree(fm_e); } spin_unlock(&ubi->wl_lock); -- cgit v1.2.3