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>
This commit is contained in:
committed by
Artem Bityutskiy
parent
8e26e1d7bc
commit
ad5942bad6
@@ -815,6 +815,7 @@ 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;
|
||||
|
Reference in New Issue
Block a user