lkml.org 
[lkml]   [2012]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/22] UBI: Fastmap: Rework ubi_wl_put_fm_peb()
Date
Signed-off-by: Richard Weinberger <richard@nod.at>
---
drivers/mtd/ubi/wl.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index a64cd83..369e07f 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -827,13 +827,14 @@ static int do_sync_erase(struct ubi_device *ubi, struct ubi_wl_entry *e,
*
* see: ubi_wl_put_peb()
*/
-int ubi_wl_put_fm_peb(struct ubi_device *ubi, struct ubi_wl_entry *used_e,
- int torture)
+int ubi_wl_put_fm_peb(struct ubi_device *ubi, struct ubi_wl_entry *fm_e,
+ int torture)
{
struct ubi_wl_entry *e;
- int pnum = used_e->pnum;
+ int pnum = fm_e->pnum;

dbg_wl("PEB %d", pnum);
+
ubi_assert(pnum >= 0);
ubi_assert(pnum < ubi->peb_count);

@@ -845,11 +846,11 @@ int ubi_wl_put_fm_peb(struct ubi_device *ubi, struct ubi_wl_entry *used_e,
* has never seen any PEB used by the original fastmap.
*/
if (!e) {
- e = used_e;
-
+ e = fm_e;
ubi_assert(e->ec);
ubi->lookuptbl[pnum] = e;
- }
+ } else
+ kfree(fm_e);

spin_unlock(&ubi->wl_lock);

--
1.7.6.5


\
 
 \ /
  Last update: 2012-06-18 20:01    [W:0.060 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site