summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-11-16 12:28:01 +0400
committerDavid Sterba <dsterba@suse.cz>2011-11-30 21:46:01 +0400
commit26bdef541d26fd6a5ddffdf8949ace22f94f809f (patch)
tree85e4db1a93d211a719cb2c1ecec384ff442e0cd9
parent24a70313969fc3fc440216b40babdb42564acff3 (diff)
downloadlinux-26bdef541d26fd6a5ddffdf8949ace22f94f809f.tar.xz
btrfs scrub: handle -ENOMEM from init_ipath()
init_ipath() can return an ERR_PTR(-ENOMEM). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
-rw-r--r--fs/btrfs/scrub.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index fab420db5121..c27bcb67f330 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -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)