Message ID | 20190418065353.1838-1-wqu@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] btrfs: volumes: Check memory allocation failure for alloc_btrfs_bio() | expand |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 78bab7803bda..7e1ad6dd672e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -5580,8 +5580,10 @@ static struct btrfs_bio *alloc_btrfs_bio(int total_stripes, int real_stripes) * and the stripes */ sizeof(u64) * (total_stripes), - GFP_NOFS|__GFP_NOFAIL); + GFP_NOFS); + if (!bbio) + return NULL; atomic_set(&bbio->error, 0); refcount_set(&bbio->refs, 1);