projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5dc23bd
)
ext4: add check to io_submit_init_bio
author
Theodore Ts'o
<tytso@mit.edu>
Thu, 6 Jun 2013 14:18:22 +0000
(10:18 -0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Thu, 6 Jun 2013 14:18:22 +0000
(10:18 -0400)
The bio_alloc() function can return NULL if the memory allocation
fails. So we need to check for this.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/page-io.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/ext4/page-io.c
b/fs/ext4/page-io.c
index ce8c15a7eabcccd8cf9231723119014a24dd885a..48786cdb5e6c8ccc9d94039d34432e8019c3d840 100644
(file)
--- a/
fs/ext4/page-io.c
+++ b/
fs/ext4/page-io.c
@@
-372,6
+372,8
@@
static int io_submit_init_bio(struct ext4_io_submit *io,
struct bio *bio;
bio = bio_alloc(GFP_NOIO, min(nvecs, BIO_MAX_PAGES));
+ if (!bio)
+ return -ENOMEM;
bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9);
bio->bi_bdev = bh->b_bdev;
bio->bi_end_io = ext4_end_bio;