diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-29 11:44:10 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-06-11 21:57:36 +0200 |
commit | 3140c9a34b44cd4013baae8704fdb34a93a44475 (patch) | |
tree | 824a5ecb5d6d1c50769d96cd48b8394c009334d5 | |
parent | Btrfs: unwind after btrfs_start_transaction() errors (diff) | |
download | linux-3140c9a34b44cd4013baae8704fdb34a93a44475.tar.xz linux-3140c9a34b44cd4013baae8704fdb34a93a44475.zip |
Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
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>
-rw-r--r-- | fs/btrfs/disk-io.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 73895baf6e07..34f7c375567e 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -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); |