Page MenuHomeFreeBSD

TCP RACK: don't log an uninitialized value
ClosedPublic

Authored by tuexen on Mon, Jan 6, 9:24 PM.
Tags
None
Referenced Files
F107021548: D48346.diff
Thu, Jan 9, 2:29 AM
F107011839: D48346.diff
Wed, Jan 8, 11:05 PM
Unknown Object (File)
Wed, Jan 8, 3:19 AM
Unknown Object (File)
Tue, Jan 7, 10:03 PM
Unknown Object (File)
Tue, Jan 7, 1:40 PM
Unknown Object (File)
Mon, Jan 6, 10:44 PM

Details

Summary

reduce is uninitialized, if the code path for logging is reached via goto old_method;.
CID: 1557359

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tuexen requested review of this revision.Mon, Jan 6, 9:24 PM
tuexen retitled this revision from TCP RACK: don't lock an uninitialized value to TCP RACK: don't log an uninitialized value.Tue, Jan 7, 8:07 AM
tuexen added a reviewer: glebius.
This revision is now accepted and ready to land.Wed, Jan 8, 4:07 PM

Why not move the old_method: label above the stack variables' declaration? I think it may be cleaner to read.
Like this:

	old_method:
		uint64_t cwnd, tr_perms = 0;
		int32_t reduce = 0;
This revision was automatically updated to reflect the committed changes.
In D48346#1103376, @cc wrote:

Why not move the old_method: label above the stack variables' declaration? I think it may be cleaner to read.
Like this:

	old_method:
		uint64_t cwnd, tr_perms = 0;
		int32_t reduce = 0;

I prefer declarations before code in a block and label inside the code block. Maybe this is just a personal preference. But I also had to look up the specification if Coverity is correct in stating that the variable might be unused...