* [patch] btrfs: uninitialized data is check_path_shared()
@ 2010-06-01 8:23 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-06-01 8:23 UTC (permalink / raw)
To: Chris Mason
Cc: Yan Zheng, Josef Bacik, Al Viro, linux-btrfs, linux-kernel,
kernel-janitors
refs can be used with uninitialized data if btrfs_lookup_extent_info()
fails on the first pass through the loop. In the original code if that
happens then check_path_shared() probably returns 1, but with this patch
it will continue through the loop.
I'm not super familiar with this code so please look it over carefully.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index fa6ccc1..9640dae 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2673,7 +2673,7 @@ static int check_path_shared(struct btrfs_root *root,
struct extent_buffer *eb;
int level;
int ret;
- u64 refs;
+ u64 refs = 0;
for (level = 0; level < BTRFS_MAX_LEVEL; level++) {
if (!path->nodes[level])
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-06-01 8:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-01 8:23 [patch] btrfs: uninitialized data is check_path_shared() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).