Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2013 15:56:21 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Justin Hibbits <chmeeedalf@gmail.com>
Cc:        svn-src-head@freebsd.org, Justin Hibbits <jhibbits@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans <brde@optusnet.com.au>
Subject:   Re: svn commit: r259080 - in head/sys: dev/iicbus geom/cache geom/journal
Message-ID:  <20131210155324.R1022@besplex.bde.org>
In-Reply-To: <20131208013614.6dc63ef9@zhabar.gateway.2wire.net>
References:  <201312071955.rB7JtYNH001792@svn.freebsd.org> <20131208123144.U883@besplex.bde.org> <20131208013614.6dc63ef9@zhabar.gateway.2wire.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 8 Dec 2013, Justin Hibbits wrote:

> On Sun, 8 Dec 2013 13:53:30 +1100 (EST)
> Bruce Evans <brde@optusnet.com.au> wrote:
>
>> On Sat, 7 Dec 2013, Justin Hibbits wrote:
>[>]* [...]
>>> Modified: head/sys/geom/cache/g_cache.c
>>> ==============================================================================
>>> --- head/sys/geom/cache/g_cache.c	Sat Dec  7 19:39:38
>>> 2013	(r259079) +++ head/sys/geom/cache/g_cache.c	Sat
>>> Dec  7 19:55:34 2013	(r259080) @@ -67,7 +67,7 @@ static
>>> u_int g_cache_used_hi = 20; static int
>>> sysctl_handle_pct(SYSCTL_HANDLER_ARGS)
>>> {
>>> -	u_int val = *(u_int *)arg1;
>>> +	int val;
>>> 	int error;
>>>
>>> 	error = sysctl_handle_int(oidp, &val, 0, req);
>>
>> This adds the larger non-style bug that val is used uninitialized.
>> Compilers should warn about this.  This results in stack garbage
>> being copied out instead of the "old" value.
>> ...
> I just reverted these two changes in r259096.  Rather than fix what I
> did and change the rest of the files, I'm leaving them for another day,
> and reverted my changes so they're at least back to the working order
> from before.

Thanks.

Does it work to just remove the check for val < 0?

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131210155324.R1022>