Received: by 10.223.164.221 with SMTP id h29csp2552061wrb; Thu, 2 Nov 2017 12:58:45 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Rn33Wu6OSnIi/MykxNERq3ySHATwY9ucMt+DEAarwOUYQcl6Tz/Jvx9l9NWKbyr50i3ihS X-Received: by 10.159.247.12 with SMTP id d12mr4256338pls.265.1509652725874; Thu, 02 Nov 2017 12:58:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509652725; cv=none; d=google.com; s=arc-20160816; b=yGXTd+pAxwUYzs2tMt8WJsi0I0VXd9iin2fKQjtH1erBSXaPh6Z9//nahmsEVH7crS j/gz+wzJQJTmo9xKnQ9q5c3nPVpj+TVnxiiSLU6CrTJ/gp1VkjWwVnKfDmoAZ2tfvCLJ eyfxR0WGoSoD6piNv/8BK2nLH5tuI9Js+L78wtK8HsUdi+0dsvkUZufyFWXdhjQTQXVQ Vj9w50P7/aWtc+G7J7Meop9g2TOztleEJl6az582NEsZRW3IzcEoWSsn2fJL4jzmaXpP PMjvx9RZSvy0oXIQwtkOc3d2qDJjeHykC4y7mZUVFlp05A19kBV2moUK15WH7lUpvk5c A9aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=HmdUG0B3Uf12fpOON6j31qmRMC8LbBhdKPMgOTrZ5To=; b=yKiKCjtctkzY1T6nvditsJujzJwhxY/7xY9JzWyYiddiIxU19JjlSRGM3H998LdOSV EZ+tB5NHGeBYxA+k2hM/U4iT9De5T840yVS2pFifaf1xO7czFZRuPEMOeMjTXUnlstqt Fy9mSycDaGv8cUSgLBMyRturzTFSBuNYVFHg3KDE5qnpXD9TIac3Uo4D2CbksxZr/9kL TiUdjQvaJwuu7iMzczq2sbssKqnnIRvZVsW0KpoBQjOx4DzpmY442K+g80Od6Py3X9el qrFOQXg/vVSJKpmtco6UeztGRSqMS6OXwYlKFUGJP8BucZaLwRHHKfyAHqmg4fBc+YXe 4ysQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si2880346plb.462.2017.11.02.12.58.23; Thu, 02 Nov 2017 12:58:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934343AbdKBT5n (ORCPT + 98 others); Thu, 2 Nov 2017 15:57:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45188 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932497AbdKBT5l (ORCPT ); Thu, 2 Nov 2017 15:57:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 91B8F5D685; Thu, 2 Nov 2017 19:57:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 91B8F5D685 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=bfoster@redhat.com Received: from bfoster.bfoster (dhcp-41-20.bos.redhat.com [10.18.41.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 752E35D758; Thu, 2 Nov 2017 19:57:41 +0000 (UTC) Received: by bfoster.bfoster (Postfix, from userid 1000) id 0395E120147; Thu, 2 Nov 2017 15:57:39 -0400 (EDT) Date: Thu, 2 Nov 2017 15:57:39 -0400 From: Brian Foster To: "Darrick J. Wong" Cc: Arnd Bergmann , linux-xfs@vger.kernel.org, Dave Chinner , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] xfs: scrub: avoid uninitialized return code Message-ID: <20171102195739.GK16645@bfoster.bfoster> References: <20171102195306.GA4911@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171102195306.GA4911@magnolia> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 02 Nov 2017 19:57:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 02, 2017 at 12:53:06PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong > > The newly added xfs_scrub_da_btree_block() function has one code path > that returns the 'error' variable without initializing it first, as > shown by this compiler warning: > > fs/xfs/scrub/dabtree.c: In function 'xfs_scrub_da_btree_block': > fs/xfs/scrub/dabtree.c:462:9: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > Return zero since the caller will exit the scrub code if we don't produce a > buffer pointer. > > Fixes: 7c4a07a424c1 ("xfs: scrub directory/attribute btrees") > Reported-by: Arnd Bergmann > Signed-off-by: Darrick J. Wong > --- Reviewed-by: Brian Foster > fs/xfs/scrub/dabtree.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c > index c21c528..4c9839c 100644 > --- a/fs/xfs/scrub/dabtree.c > +++ b/fs/xfs/scrub/dabtree.c > @@ -336,7 +336,7 @@ xfs_scrub_da_btree_block( > xfs_ino_t owner; > int *pmaxrecs; > struct xfs_da3_icnode_hdr nodehdr; > - int error; > + int error = 0; > > blk = &ds->state->path.blk[level]; > ds->state->path.active = level + 1; From 1582985327195149919@xxx Thu Nov 02 19:54:09 +0000 2017 X-GM-THRID: 1582952557462660820 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread