Skip to content

Commit 26bdef5

Browse files
Dan Carpenterkdave
authored andcommitted
btrfs scrub: handle -ENOMEM from init_ipath()
init_ipath() can return an ERR_PTR(-ENOMEM). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
1 parent 24a7031 commit 26bdef5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎fs/btrfs/scrub.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root, void *ctx)
256256
btrfs_release_path(swarn->path);
257257

258258
ipath = init_ipath(4096, local_root, swarn->path);
259+
if (IS_ERR(ipath)) {
260+
ret = PTR_ERR(ipath);
261+
ipath = NULL;
262+
goto err;
263+
}
259264
ret = paths_from_inode(inum, ipath);
260265

261266
if (ret < 0)

0 commit comments

Comments
 (0)