The alloc_dummy_extent_buffer() function does not return error pointers, it returns NULL on failure. Fixes: 5068210cf625 ("btrfs: use dummy extent buffer for super block sys chunk array read") Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> --- fs/btrfs/volumes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 98ad92041ae4..791dd31360f9 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -7389,8 +7389,8 @@ int btrfs_read_sys_array(struct btrfs_fs_info *fs_info) * that's fine, we will not go beyond system chunk array anyway. */ sb = alloc_dummy_extent_buffer(fs_info, BTRFS_SUPER_INFO_OFFSET); - if (IS_ERR(sb)) - return PTR_ERR(sb); + if (!sb) + return -ENOMEM; set_extent_buffer_uptodate(sb); write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE); -- 2.20.1