Bug 136235 - local variable used before set
local variable used before set
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: e2fsprogs (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Stephen Tweedie
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-18 16:20 EDT by David Binderman
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-10 16:38:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Binderman 2004-10-18 16:20:12 EDT
Description of problem:

I just tried to compile package e2fsprogs-1.35-11 from package
Redhat Fedora Core 3 Test 3.

The compiler said

ext2.c(421): remark #592: variable "bh2" is used before its value is set

The source code is

                struct ext2_buffer_head *bh2;
                __u32                   *udata2;
                int                      j;

                if (!udata[i]) {
                        ext2_brelse(bh, 0);
                        ext2_brelse(bh2, 0);

Suggest init bh2 before first use.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Thomas Woerner 2004-10-19 09:21:10 EDT
This is really a problem:

void ext2_brelse(struct ext2_buffer_head *bh, int forget)
{
	if (bh->usecount-- == 1 && forget) {
		if (bh->dirty)
			ext2_bh_do_write(bh);

		ext2_bh_dealloc(bh);
	}
}
Comment 2 David Binderman 2005-03-10 05:02:22 EST
>This is really a problem:

Is the code you provide a proposed solution ?

In any event, the original code is still broken in March 2005,
some five months later.
Comment 3 Stephen Tweedie 2005-03-10 16:38:31 EST
The bug is real, but the code is not actually used in this package.  

That function is only used for "ext2resize" offline resizing and
"e2prepare" resize preparation.   But these days offline resize is
performed by resize2fs in upstream e2fsprogs, and e2prepare is not yet
ready for online resize; so neither binaries are actually packaged in
our e2fsprogs RPM.


Note You need to log in before you can comment on or make changes to this bug.