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>
This commit is contained in:

committed by
Chris Mason

parent
c87fb6fdca
commit
5df6708348
@@ -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;
|
||||
|
Reference in New Issue
Block a user