diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-06-04 16:48:12 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-07-24 13:32:54 +0300 |
commit | abc5e92262d87f9c5c628492bffc55f81c7dcb80 (patch) | |
tree | ad33229247f99996dd875e68c10dcef9d1d40519 /drivers/mtd/ubi/build.c | |
parent | cadb40ccc16a26a738f1cbc963e35b21edd93e79 (diff) | |
download | op-kernel-dev-abc5e92262d87f9c5c628492bffc55f81c7dcb80.zip op-kernel-dev-abc5e92262d87f9c5c628492bffc55f81c7dcb80.tar.gz |
UBI: fix memory leak
ubi_free_volume() function sets ubi->volumes[] to NULL, so
ubi_eba_close() is useless, it does not free what has to be freed.
So zap it and free vol->eba_tbl at the volume release function.
Pointed-out-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/build.c')
-rw-r--r-- | drivers/mtd/ubi/build.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index ff4425d..7b42b4d 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -840,7 +840,6 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) out_uif: uif_close(ubi); out_detach: - ubi_eba_close(ubi); ubi_wl_close(ubi); vfree(ubi->vtbl); out_free: @@ -903,7 +902,6 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway) kthread_stop(ubi->bgt_thread); uif_close(ubi); - ubi_eba_close(ubi); ubi_wl_close(ubi); vfree(ubi->vtbl); put_mtd_device(ubi->mtd); |