lkml.org 
[lkml]   [2013]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/7] UBI: Call scan_all() with correct offset in error case
    Date
    If we find an invalid fastmap we have to scan from the very beginning.
    Otherwise we leak the first 64 PEBs.

    Reported-and-tested-by: Richard Genoud <richard.genoud@gmail.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    ---
    drivers/mtd/ubi/attach.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
    index c071d41..03b32b0 100644
    --- a/drivers/mtd/ubi/attach.c
    +++ b/drivers/mtd/ubi/attach.c
    @@ -1417,9 +1417,11 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
    ai = alloc_ai("ubi_aeb_slab_cache2");
    if (!ai)
    return -ENOMEM;
    - }

    - err = scan_all(ubi, ai, UBI_FM_MAX_START);
    + err = scan_all(ubi, ai, 0);
    + } else {
    + err = scan_all(ubi, ai, UBI_FM_MAX_START);
    + }
    }
    }
    #else
    --
    1.8.3.1


    \
     
     \ /
      Last update: 2013-09-28 16:21    [W:2.058 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site