From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49002 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6yRj-0003JI-9d for qemu-devel@nongnu.org; Tue, 05 Apr 2011 01:04:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6yRi-0000nu-HM for qemu-devel@nongnu.org; Tue, 05 Apr 2011 01:04:55 -0400 Received: from gate.crashing.org ([63.228.1.57]:48303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6yRi-0000nA-9C for qemu-devel@nongnu.org; Tue, 05 Apr 2011 01:04:54 -0400 From: Benjamin Herrenschmidt In-Reply-To: <20110405041459.GC466@yookeroo> References: <1301847684-8125-1-git-send-email-weil@mail.berlios.de> <4D99DDD0.5070107@suse.de> <20110405041459.GC466@yookeroo> Content-Type: text/plain; charset="UTF-8" Date: Tue, 05 Apr 2011 15:04:40 +1000 Message-ID: <1301979880.2549.119.camel@pasglop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] spapr_vscsi: Set uninitialized variable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Alexander Graf , QEMU Developers On Tue, 2011-04-05 at 14:14 +1000, David Gibson wrote: > > >@@ -255,7 +255,7 @@ static int vscsi_srp_direct_data(VSCSIState *s, > vscsi_req *req, > > > { > > > struct srp_direct_buf *md = req->cur_desc; > > > uint32_t llen; > > >- int rc; > > >+ int rc = 0; > > > > David, is this correct? Or would rc be -1 when !llen? > > I talked to Ben, who wrote this code - apparently his mail server blew > up. This patch should be correct, AFAWCT. It's not totally clear > what the right return value should be in thie case, or indeed that > this case ever actually happens, but we think 0 is right. Just double checked and we never call that function if len is 0 Cheers, Ben.