public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] btrfs scrub: handle -ENOMEM from init_ipath()
@ 2011-11-16  8:28 Dan Carpenter
  2011-11-16 16:56 ` Jan Schmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-11-16  8:28 UTC (permalink / raw)
  To: Chris Mason; +Cc: linux-btrfs, kernel-janitors

init_ipath() can return an ERR_PTR(-ENOMEM).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index ed11d38..b72ee47 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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-16 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16  8:28 [patch] btrfs scrub: handle -ENOMEM from init_ipath() Dan Carpenter
2011-11-16 16:56 ` Jan Schmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox