From: Dan Carpenter Date: Sat, 29 May 2010 09:44:10 +0000 (+0000) Subject: Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs X-Git-Tag: MMI-PSA29.97-13-9~23186^2~9 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3140c9a34b44cd4013baae8704fdb34a93a44475;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Chris Mason --- 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);