Skip to contentSkip to conversation

automated tool detected uninitialized variable use in ocfs2_local_alloc_find_clear_bits

PATCH New Tariq Saeed 2 participants 2 messages Apr 10, 2015 – Apr 16, 2015 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 automated tool detected uninitialized variable use in ocfs2_local_alloc_find_clear_bits

Orabug: 19060842

In ocfs2_local_alloc_find_clear_bits(), local int numbits is used without being initialized in an error path.

---
 fs/ocfs2/localalloc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/ocfs2/localalloc.c +1 -0
index 0440134..978a6e0 100644
@@ -847,6 +847,7 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb,
 
 	if (!alloc->id1.bitmap1.i_total) {
 		bitoff = -1;
+		numfound = -1;
 		goto bail;
 	}
 
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 automated tool detected uninitialized variable use in ocfs2_local_alloc_find_clear_bits

Hi Tariq,

This have been fixed by upstream commit 023d4ea358494ccfeb37abfe5b0fd01b45a6051c ("ocfs2: fix possible uninitialized variable access").

Thanks,
Junxiao.

Quoted 23 lines · Tariq Saeed

Orabug: 19060842

In ocfs2_local_alloc_find_clear_bits(), local int numbits is used without being initialized in an error path.

---
 fs/ocfs2/localalloc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/ocfs2/localalloc.c +1 -0
index 0440134..978a6e0 100644
@@ -847,6 +847,7 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb,
 
 	if (!alloc->id1.bitmap1.i_total) {
 		bitoff = -1;
+		numfound = -1;
 		goto bail;
 	}