Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1535603
| From | Pan Bian <bianpan201604@163.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/1] mtd: ubi: fix improper return value |
| Date | 2016-12-04 07:20 +0100 |
| Message-ID | <sKyjw-3Ap-9@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
From: Pan Bian <bianpan2016@163.com>
When __vmalloc() returns a NULL pointer, the region is not checked, and
we cannot make sure that only 0xFF bytes are present at offset. Thus,
returning 0 seems improper.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189081
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
drivers/mtd/ubi/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index b6fb8f9..b54fe05 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -1413,7 +1413,7 @@ int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len)
buf = __vmalloc(len, GFP_NOFS, PAGE_KERNEL);
if (!buf) {
ubi_err(ubi, "cannot allocate memory to check for 0xFFs");
- return 0;
+ return -ENOMEM;
}
err = mtd_read(ubi->mtd, addr, len, &read, buf);
--
1.9.1
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/1] mtd: ubi: fix improper return value Pan Bian <bianpan201604@163.com> - 2016-12-04 07:20 +0100
Re: [PATCH 1/1] mtd: ubi: fix improper return value Marek Vasut <marek.vasut@gmail.com> - 2016-12-04 16:40 +0100
Re: [PATCH 1/1] mtd: ubi: fix improper return value Joe Perches <joe@perches.com> - 2016-12-04 21:40 +0100
Re: [PATCH 1/1] mtd: ubi: fix improper return value Richard Weinberger <richard@nod.at> - 2016-12-04 22:00 +0100
Re: [PATCH 1/1] mtd: ubi: fix improper return value Artem Bityutskiy <dedekind1@gmail.com> - 2016-12-05 08:10 +0100
Re: [PATCH 1/1] mtd: ubi: fix improper return value Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-12-05 09:30 +0100
Re: [PATCH 1/1] mtd: ubi: fix improper return value Artem Bityutskiy <dedekind1@gmail.com> - 2016-12-05 11:00 +0100
Re: [PATCH 1/1] mtd: ubi: fix improper return value Marek Vasut <marek.vasut@gmail.com> - 2016-12-04 22:40 +0100
csiph-web