Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Jan 2015 01:48:40 -0800
From:      Colin Percival <cperciva@freebsd.org>
To:        Hans Petter Selasky <hselasky@FreeBSD.org>,  src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org, =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <royger@FreeBSD.org>
Subject:   Re: svn commit: r276530 - head/sys/x86/xen
Message-ID:  <54A66978.1070108@freebsd.org>
In-Reply-To: <201501020842.t028gjxm080990@svn.freebsd.org>
References:  <201501020842.t028gjxm080990@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01/02/15 00:42, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Fri Jan  2 08:42:44 2015
> New Revision: 276530
> URL: https://svnweb.freebsd.org/changeset/base/276530
> 
> Log:
>   Fix warning about possible use of uninitialized variable.

Looks to me like the right solution here would be to add
	bool initial_domain = xen_initial_domain();
and then s/xen_initial_domain()/initial_domain/ in the rest of the
function.  That should make it clear to static analysis tools that
acpi_dev will not be used uninitialized -- since the problem right
now is that they don't know that xen_initial_domain() always returns
the same value --  without having a bogus initialization which could
hide a future bug.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid



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