Commit cf1e99a4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Chris Mason

Btrfs: btrfs_lookup_dir_item() can return ERR_PTR

btrfs_lookup_dir_item() can return either ERR_PTRs or null.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 3140c9a3
...@@ -1845,7 +1845,7 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) ...@@ -1845,7 +1845,7 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
dir_id = btrfs_super_root_dir(&root->fs_info->super_copy); dir_id = btrfs_super_root_dir(&root->fs_info->super_copy);
di = btrfs_lookup_dir_item(trans, root->fs_info->tree_root, path, di = btrfs_lookup_dir_item(trans, root->fs_info->tree_root, path,
dir_id, "default", 7, 1); dir_id, "default", 7, 1);
if (!di) { if (IS_ERR_OR_NULL(di)) {
btrfs_free_path(path); btrfs_free_path(path);
btrfs_end_transaction(trans, root); btrfs_end_transaction(trans, root);
printk(KERN_ERR "Umm, you don't have the default dir item, " printk(KERN_ERR "Umm, you don't have the default dir item, "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment