diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2012-04-12 16:03:56 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-04-12 16:03:56 -0400 |
commit | e627ee7bcd42b4e3a03ca01a8e46dcb4033c5ae0 (patch) | |
tree | a6f8060dd57184e79b5c46404c941f999137030d /fs/btrfs/extent_io.c | |
parent | c6664b42c4e567792abdb17c958fb01c5bcfcb3a (diff) | |
download | op-kernel-dev-e627ee7bcd42b4e3a03ca01a8e46dcb4033c5ae0.zip op-kernel-dev-e627ee7bcd42b4e3a03ca01a8e46dcb4033c5ae0.tar.gz |
Btrfs: check return value of bio_alloc() properly
bio_alloc() has the possibility of returning NULL.
So, it is necessary to check the return value.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 59ec105..4789770 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2180,6 +2180,10 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page, } bio = bio_alloc(GFP_NOFS, 1); + if (!bio) { + free_io_failure(inode, failrec, 0); + return -EIO; + } bio->bi_private = state; bio->bi_end_io = failed_bio->bi_end_io; bio->bi_sector = failrec->logical >> 9; |