From: Ian Campbell Subject: Re: [blktap2] fix two 'maybe uninitialized' variables Date: Wed, 18 Jun 2014 15:02:09 +0100 Message-ID: <1403100129.6568.30.camel@kazak.uk.xensource.com> References: <1402488062.16827.90.camel@Solace> <1402564712.8162.5.camel@kazak.uk.xensource.com> <1402565442.28649.44.camel@Solace> <1402573205.28649.80.camel@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WxGS2-00056x-Ow for xen-devel@lists.xenproject.org; Wed, 18 Jun 2014 14:02:58 +0000 In-Reply-To: <1402573205.28649.80.camel@Solace> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: raistlin@linux.it Cc: xen-devel@lists.xenproject.org, Keir Fraser , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Thu, 2014-06-12 at 13:40 +0200, Dario Faggioli wrote: > So, I'd have to ask to someone who's more into that code to advise, I'm > afraid. :-/ There is no such person I'm afraid and hasn't been for some years. In the absence of a blktap2 maintainer and/or the absence of any voices to the contrary I'm inclined to take this, it seems to return the same error code as other failures in this function. Please resubmit without the spacespace damage and with a commit log and S-o-b. > > Thanks and Regards, > Dario > > --- > diff --git a/tools/blktap2/drivers/block-qcow.c b/tools/blktap2/drivers/block-qcow.c > index d5053d4..b45bcaa 100644 > --- a/tools/blktap2/drivers/block-qcow.c > +++ b/tools/blktap2/drivers/block-qcow.c > @@ -427,6 +427,7 @@ static uint64_t get_cluster_offset(struct tdqcow_state *s, > > if (posix_memalign((void **)&tmp_ptr, 4096, 4096) != 0) { > DPRINTF("ERROR allocating memory for L1 table\n"); > + return 0; > } > memcpy(tmp_ptr, l1_ptr, 4096); > > @@ -600,6 +601,7 @@ found: > > if (posix_memalign((void **)&tmp_ptr2, 4096, 4096) != 0) { > DPRINTF("ERROR allocating memory for L1 table\n"); > + return 0; > } > memcpy(tmp_ptr2, l2_ptr, 4096); > lseek(s->fd, l2_offset + (l2_sector << 12), SEEK_SET); >