diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2011-02-01 09:17:35 +0000 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-02-01 07:16:37 -0500 |
commit | 5df67083488ccbad925f583b698ab38f8629a016 (patch) | |
tree | ec428f27f1b72c4d8e284831d4bef8894b2b8457 /fs/btrfs/extent_io.c | |
parent | c87fb6fdcaf7560940b31a0c78c3e6370e3433cf (diff) |
btrfs: checking NULL or not in some functions
Because NULL is returned when the memory allocation fails,
it is checked whether it is NULL.
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 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 6411ed6ca44..8862dda46ff 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1920,6 +1920,8 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, nr = bio_get_nr_vecs(bdev); bio = btrfs_bio_alloc(bdev, sector, nr, GFP_NOFS | __GFP_HIGH); + if (!bio) + return -ENOMEM; bio_add_page(bio, page, page_size, offset); bio->bi_end_io = end_io_func; |