Skip to content

Commit

Permalink
UBI: fix freeing ubi->vtbl while unloading
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vinit Agnihotri authored and Artem Bityutskiy committed Jul 18, 2007
1 parent 2160054 commit d7f0c4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/ubi/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d7f0c4d

Please sign in to comment.