Skip to content

Commit

Permalink
btrfs scrub: handle -ENOMEM from init_ipath()
Browse files Browse the repository at this point in the history
init_ipath() can return an ERR_PTR(-ENOMEM).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
  • Loading branch information
Dan Carpenter authored and David Sterba committed Nov 30, 2011
1 parent 24a7031 commit 26bdef5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/btrfs/scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root, void *ctx)
btrfs_release_path(swarn->path);

ipath = init_ipath(4096, local_root, swarn->path);
if (IS_ERR(ipath)) {
ret = PTR_ERR(ipath);
ipath = NULL;
goto err;
}
ret = paths_from_inode(inum, ipath);

if (ret < 0)
Expand Down

0 comments on commit 26bdef5

Please sign in to comment.