提交 a1d8d9a7 编写于 作者: T Theodore Ts'o

ext4: add check to io_submit_init_bio

The bio_alloc() function can return NULL if the memory allocation
fails.  So we need to check for this.
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 5dc23bdd
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册