Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad5942ba authored by Stefan Roese's avatar Stefan Roese Committed by Artem Bityutskiy
Browse files

UBI: return -ENOMEM upon failing vmalloc



Return with correct error code (-ENOMEM) from ubi_attach_mtd_dev() upon
failing vmalloc().

Signed-off-by: default avatarStefan Roese <sr@denx.de>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 8e26e1d7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;