Browse Source

UBI: mtd/ubi/vtbl.c: fix memory leak

This patch fixes a memory leak introduced by commit
4ccf8cffa963c7b5bdc6d455ea9417084ee49aa8 and spotted by the Coverity
checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Adrian Bunk 17 years ago
parent
commit
f7f0283776
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/mtd/ubi/vtbl.c

+ 1 - 0
drivers/mtd/ubi/vtbl.c

@@ -519,6 +519,7 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si,
 			if (ubi->autoresize_vol_id != -1) {
 			if (ubi->autoresize_vol_id != -1) {
 				ubi_err("more then one auto-resize volume (%d "
 				ubi_err("more then one auto-resize volume (%d "
 					"and %d)", ubi->autoresize_vol_id, i);
 					"and %d)", ubi->autoresize_vol_id, i);
+				kfree(vol);
 				return -EINVAL;
 				return -EINVAL;
 			}
 			}