From owner-svn-src-all@freebsd.org Sun Apr 3 18:01:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B81D6B01E31 for ; Sun, 3 Apr 2016 18:01:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm39.bullet.mail.bf1.yahoo.com (nm39.bullet.mail.bf1.yahoo.com [72.30.239.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 718F81355 for ; Sun, 3 Apr 2016 18:01:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1459706109; bh=UbLz1xp2rQSasSVimXaG0roESG9csrVkuUgoqADoE5w=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=sccl/YHUfhDC8WJ1yilSbVrW7aXwK8wGqNRg+5BfwOIw3QNh2dKFjop9OSvu0TJNpayVAFjj7X/Yk3c27Xm1aLbquQGgm1BjqHr8KVG7LTGsqyJZJWV5rOO6Dcd95KrLnjKKvxtnfe1y5+1d6mxB37S22A9pzaWSWIb1CoS8v+rlorhyu9uegbBaXSXO61sWYHQa7XOG0vHncRoi8Vje8YaZk36SBoQiu+5egs4Xt0GPPiq4DUo4Kju3NJ260M2xosbOYkTep8TE9XIHv8CKDvZTcUvlPF34jZOadclVwjBA8cu9ElBHsaskGaf7WxLQIEbp49+VBrHltP0NZJ2PZA== Received: from [98.139.215.143] by nm39.bullet.mail.bf1.yahoo.com with NNFMP; 03 Apr 2016 17:55:09 -0000 Received: from [98.139.211.206] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 03 Apr 2016 17:55:09 -0000 Received: from [127.0.0.1] by smtp215.mail.bf1.yahoo.com with NNFMP; 03 Apr 2016 17:55:09 -0000 X-Yahoo-Newman-Id: 667111.73775.bm@smtp215.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ZP6n67cVM1lm48S2x5UXEcGC2U8z2lw8Htom._SpfW.7q0l fmufoIoB5DYHSIaA0gK0cXCbd2qoF9CnFG3wmsgRWutNl6A2Abs38D0DVZcm ZTQ8J31IHVEBDwzzLTcAliKnFp.DNj1mTPcClliDtW6XbBhXikj7_Xvt2pnG RJJkkWwLqFoq7n0tbmFycR4Zjo4xVzAkZi64LVFOmVH1p3BTboHaT9wYw47Q O1ZgNLkxfifhKpGnuiw3L7Kie56biL5VODpgDANytKGLMIRWxXM5mGxkrTyw 4z9sKAuwdqfTcgEzk9eqPybjTZ0ham.Ga_lr92dawLMfQRYUOeAWxqHpHt9u ZdLIdecC141vH2k1oDJ0sA031DduLGUfVb22i6IKXn8E31j1BCztwBFrPMMn H.5sGj1l.PmAqRnOS77ijajbTFLeBUzPrMKVRcYV6M0mj4JD4u4I5BXB6gfw 0JjPBjzu1XrFilf.Se5HOgIwXc.DHYPoecm.oCsFfaRg74vvA.4fc5oB2Zyz xoPjCbcb9RI6XYkMT7RGsuUZQN1j_Ki_c X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r297526 - head/sys/geom/sched To: Kevin Lo References: <201604031625.u33GPpnK088911@repo.freebsd.org> <20160403165827.GA24850@ns.kevlo.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <5701595A.9070605@FreeBSD.org> Date: Sun, 3 Apr 2016 12:56:42 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <20160403165827.GA24850@ns.kevlo.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2016 18:01:27 -0000 On 04/03/16 11:58, Kevin Lo wrote: > On Sun, Apr 03, 2016 at 04:25:51PM +0000, Pedro F. Giffuni wrote: >> >> Author: pfg >> Date: Sun Apr 3 16:25:51 2016 >> New Revision: 297526 >> URL: https://svnweb.freebsd.org/changeset/base/297526 >> >> Log: >> g_sched_destroy(): prevent return of uninitialized scalar variable. >> >> For the !gsp case there some chance of returning an uninitialized >> return value. Prevent that from happening by initializing the >> error value. > > Hmm, wouldn't it be better to initialize 'error' before use? > No. The if case initializes error on line 1278, the only problem is the else case. > Index: sys/geom/sched/g_sched.c > =================================================================== > --- sys/geom/sched/g_sched.c (revision 297527) > +++ sys/geom/sched/g_sched.c (working copy) > @@ -1236,7 +1236,7 @@ g_sched_destroy(struct g_geom *gp, boolean_t force > struct g_provider *pp, *oldpp = NULL; > struct g_sched_softc *sc; > struct g_gsched *gsp; > - int error; > + int error = 0; > > g_topology_assert(); > sc = gp->softc; Even when this is frequent, it is against style(9). Pedro.