diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-29 09:44:10 +0000 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-06-11 15:57:36 -0400 |
commit | 3140c9a34b44cd4013baae8704fdb34a93a44475 (patch) | |
tree | 824a5ecb5d6d1c50769d96cd48b8394c009334d5 | |
parent | d327099a23e3d0c8ec09137e9b4b115449d4eb29 (diff) | |
download | op-kernel-dev-3140c9a34b44cd4013baae8704fdb34a93a44475.zip op-kernel-dev-3140c9a34b44cd4013baae8704fdb34a93a44475.tar.gz |
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 73895ba..34f7c37 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); |