Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3133646pxj; Mon, 17 May 2021 18:40:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxapmWVi0IOCWttSLEuMmZFVjjm7r67euYkhqlwQ+1sCPwL6IjCmOIGeEW3XJBpBsI86xbp X-Received: by 2002:a02:bb98:: with SMTP id g24mr2873097jan.19.1621302017330; Mon, 17 May 2021 18:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621302017; cv=none; d=google.com; s=arc-20160816; b=p1MJb9ClvmDGxFtka6wVfYVWv9yJBCrHTztU5dXO0AzA+9grUqNOswCQ+KUSgqN/uS x2EMey/skO8ixETu6Y/nj2tuUVAxO/sJusPo/XIANQLcjuDIwJbkpb8cXllFOqsYhEzU Q5JwEEJSk5SOGfrF6OAeuTdTvlwx1HVwBA2BLr92UrJbvo6d9cmXaR+kMYtC/vdxCTWP TrZea53JzS2y+qVJE1JPY1VJfSyGZtqO+BF1Rgib2KNzpTpmtFfcYCuTeM39XTv3G8vI CsmZg7AE5taanLy9r4r2DasfEkAtCiAsWlqAmIxlRCyMcaoiYfXulv985rFMlgxO1sEv o6lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1hpHv4op4z1Ay/OX2dZziwNSKYT9PisIsL21DiktNYE=; b=Plw3xWMv7TP4g9UdYNy1CITh6j5TCPdXDAw8VCZlTC2CMOUnXknaAPexm5dSGlsyA3 AUYIm6QIJEZUn50Ua3QVg9b/H355H+2AYlY+9qvx+hjPwTzq2DKIbjEvRDlayToBqo/s nO1L6e42Tahsu11WsIWwItVojLjVuC8BeustsljKc5zaD4d4mZwqjDEi1ppTkAjjMx2Z i04u71SZTTpxGXZpk5FO1vTzB6MioXPjLOa3Yxo2LFzO81MkdDGBJ3B5w/hg3shxLe80 yP7uwRAClBD6CFHN7H1v9nNcG+bGPqycJss6V4hdoMrLcg7BDDJy/k6BOIsY6HSSWunM Djkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="pd/EcBjt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si19809922ilq.36.2021.05.17.18.39.54; Mon, 17 May 2021 18:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="pd/EcBjt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240800AbhEQOfR (ORCPT + 99 others); Mon, 17 May 2021 10:35:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:40556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238621AbhEQOaQ (ORCPT ); Mon, 17 May 2021 10:30:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 963B961876; Mon, 17 May 2021 14:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260920; bh=/2QN11yCxaU90AlgXlB0oH0bQV4rg6Z61sPQRj3+nkc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pd/EcBjtj16xGFQ6Wcp/TeSbfjCbVdbBi64qwJ++vkvzHyCRjLIX2YSS6p5ceVPvl izUWw2a0tGHNzaC7wOHGDS7e43XVOxA0CWBl3akLR4EzLKtrVKmK79G8zVMejAxi93 gEJboC7HqqOPF/TB2n+vovjM8cIsX8e0k+AHuMb0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , David Sterba Subject: [PATCH 5.12 267/363] btrfs: initialize return variable in cleanup_free_space_cache_v1 Date: Mon, 17 May 2021 16:02:13 +0200 Message-Id: <20210517140311.640237192@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Rix commit 77364faf21b4105ee5adbb4844fdfb461334d249 upstream. Static analysis reports this problem free-space-cache.c:3965:2: warning: Undefined or garbage value returned return ret; ^~~~~~~~~~ ret is set in the node handling loop. Treat doing nothing as a success and initialize ret to 0, although it's unlikely the loop would be skipped. We always have block groups, but as it could lead to transaction abort in the caller it's better to be safe. CC: stable@vger.kernel.org # 5.12+ Signed-off-by: Tom Rix Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/free-space-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -3942,7 +3942,7 @@ static int cleanup_free_space_cache_v1(s { struct btrfs_block_group *block_group; struct rb_node *node; - int ret; + int ret = 0; btrfs_info(fs_info, "cleaning free space cache v1");