소스 검색

Btrfs: disk-io.c (open_ctree): Don't deref. NULL upon failed kzalloc

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Jim Meyering 16 년 전
부모
커밋
0463bb4e8d
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      fs/btrfs/disk-io.c

+ 2 - 1
fs/btrfs/disk-io.c

@@ -1371,7 +1371,8 @@ struct btrfs_root *open_ctree(struct super_block *sb,
 
 	struct btrfs_super_block *disk_super;
 
-	if (!extent_root || !tree_root || !fs_info) {
+	if (!extent_root || !tree_root || !fs_info ||
+	    !chunk_root || !dev_root) {
 		err = -ENOMEM;
 		goto fail;
 	}