diff options
author | Stefan Roese <sr@denx.de> | 2008-12-10 10:42:54 +0100 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-12-10 14:28:48 +0200 |
commit | ad5942bad6addcf9697a74413b517d9724d803a4 (patch) | |
tree | efaf29500212d1ae0be78377e9aa3cc607959719 /drivers/mtd/ubi | |
parent | 8e26e1d7bce73acf6f995a4d252610e46ee831a5 (diff) | |
download | op-kernel-dev-ad5942bad6addcf9697a74413b517d9724d803a4.zip op-kernel-dev-ad5942bad6addcf9697a74413b517d9724d803a4.tar.gz |
UBI: return -ENOMEM upon failing vmalloc
Return with correct error code (-ENOMEM) from ubi_attach_mtd_dev() upon
failing vmalloc().
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r-- | drivers/mtd/ubi/build.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index c7630a2..ba0bd3d 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -815,19 +815,20 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) if (err) goto out_free; + err = -ENOMEM; ubi->peb_buf1 = vmalloc(ubi->peb_size); if (!ubi->peb_buf1) goto out_free; ubi->peb_buf2 = vmalloc(ubi->peb_size); if (!ubi->peb_buf2) - goto out_free; + goto out_free; #ifdef CONFIG_MTD_UBI_DEBUG mutex_init(&ubi->dbg_buf_mutex); ubi->dbg_peb_buf = vmalloc(ubi->peb_size); if (!ubi->dbg_peb_buf) - goto out_free; + goto out_free; #endif err = attach_by_scanning(ubi); |