]> err.no Git - linux-2.6/commitdiff
UBI: fix freeing ubi->vtbl while unloading
authorVinit Agnihotri <vinit.agnihotri@gmail.com>
Fri, 15 Jun 2007 10:01:22 +0000 (15:31 +0530)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 18 Jul 2007 13:54:15 +0000 (16:54 +0300)
ubi->vtbl is allocated using vmalloc() in vtbl.c empty_create_lvol(),
but it is freed in build.c with kfree()

Signed-off-by: Vinit Agnihotri <vinit.agnihotri@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/build.c

index 054a88dcc7a1049bd6f2a36b0ead39c55eea6f0a..08ca214abb957a80b5f76f18f99860eb3aa28b94 100644 (file)
@@ -369,7 +369,7 @@ static int attach_by_scanning(struct ubi_device *ubi)
 out_wl:
        ubi_wl_close(ubi);
 out_vtbl:
-       kfree(ubi->vtbl);
+       vfree(ubi->vtbl);
 out_si:
        ubi_scan_destroy_si(si);
        return err;
@@ -629,7 +629,7 @@ static int attach_mtd_dev(const char *mtd_dev, int vid_hdr_offset,
 out_detach:
        ubi_eba_close(ubi);
        ubi_wl_close(ubi);
-       kfree(ubi->vtbl);
+       vfree(ubi->vtbl);
 out_free:
        kfree(ubi);
 out_mtd: