Skip to content

Commit

Permalink
Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
Browse files Browse the repository at this point in the history
btrfs_read_fs_root_no_name() returns ERR_PTRs on error so I added a
check for that.  It's not clear to me if it can also return NULL
pointers or not so I left the original NULL pointer check as is.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
error27 authored and chrismason-xx committed Jun 11, 2010
1 parent d327099 commit 3140c9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/btrfs/disk-io.c
Expand Up @@ -1985,6 +1985,10 @@ struct btrfs_root *open_ctree(struct super_block *sb,
fs_info->fs_root = btrfs_read_fs_root_no_name(fs_info, &location);
if (!fs_info->fs_root)
goto fail_trans_kthread;
if (IS_ERR(fs_info->fs_root)) {
err = PTR_ERR(fs_info->fs_root);
goto fail_trans_kthread;
}

if (!(sb->s_flags & MS_RDONLY)) {
down_read(&fs_info->cleanup_work_sem);
Expand Down

0 comments on commit 3140c9a

Please sign in to comment.