Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1458220pxb; Tue, 8 Feb 2022 18:45:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVYQ7SXoPer22cnAWKBN2nLV95aEZ6IHKE4NOsy9UB1kSpk0HLK6Gj1xdu4jV00LogXOlN X-Received: by 2002:a17:903:1111:: with SMTP id n17mr163631plh.128.1644374740119; Tue, 08 Feb 2022 18:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644374740; cv=none; d=google.com; s=arc-20160816; b=GJrR8o74t6YMUrUjDfBOHhpRagz6iVbMEDFM/4l9+7vW64Qt+fyeKCwOF2ll0ng2Fw 8OBbCUs/jjYK4qw/bptM4JXXJvBcXbE52dxawTtYMEFeINuD9mtgT4vASqJIiMJUzSRW nhss0TG765vu/6WmYfbSX2Mbc4XFN9XuWMNYQhROnDs8PL44nzu64ooXy2Imo+oKui1Q Fb7NTRsEEAh5Ru6hdYTqeGDOOmMbhxth675MDyzUULmIhmXaWMPKLB0TYJCe9M6jH+KX U4fGzcUa2xXUev1l5P4C+8m/Pwiro6Fh1R9bNsJ7Bw6GwWjRHDpOec9DNqXYQrv+iEQQ AwYA== 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=/qKbOiHVI1qngOalaFbwnwj+WPZeulxgEoCr+ZR88ng=; b=I1n9RsGlXs2EmCabGMNdW/H/Uy/7i/g1aqTMqYJQd+Bet2e26FiWIgIOiWNPab1urL HRvHL3LjXMet5GfIniNNTbWLlXLI86iP5VIUeE7uWvxrKcwg99JGqtD9j9O6e31w/yxZ wH27Bou6Z9ktEN6qcXM/1Liv24VGFGgfWh7x74ewgFm1G2PEG2HzTECSUYb2deTzk/yY 0CDCYZoXSAaExrFJk/SCCruTqDab2eJ6A33NK9q52Iy4NL/n71RGxbN1nvayBMaiTrrE 7whbHuZ14ddnvlSOdrwm7gue+Azc82iC3ViCrav851ZOe/BHccupVxGjeiVZ1wN7B9JE WAMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Apvbl6NM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u18si3278140plg.28.2022.02.08.18.45.27; Tue, 08 Feb 2022 18:45:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Apvbl6NM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1391492AbiBGMCA (ORCPT + 99 others); Mon, 7 Feb 2022 07:02:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386791AbiBGLhA (ORCPT ); Mon, 7 Feb 2022 06:37:00 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BF85C043188; Mon, 7 Feb 2022 03:37:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CCA996091A; Mon, 7 Feb 2022 11:36:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FE55C004E1; Mon, 7 Feb 2022 11:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233819; bh=djEWEpnDCk7CcnGly2CXbCMMBRAixEGBx4BvC4JPjCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Apvbl6NMzg4LjzuN/CnA6CrezgJeMBL1lvWsGDMtmpY7DPCW3g6o16VItoiqHWKle 9EIttKGVBCHVQ/AoCPSP1RAwDUrg67S+QpbRDESFfPKOh6by5REbhAWXjyyvd6TyjX on4DPoNxD2AnCZi+LGqvWxj9oSwiahcZO7sqninY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Filipe Manana , Anand Jain , Tom Rix , David Sterba Subject: [PATCH 5.16 097/126] btrfs: fix use of uninitialized variable at rm device ioctl Date: Mon, 7 Feb 2022 12:07:08 +0100 Message-Id: <20220207103807.431628136@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103804.053675072@linuxfoundation.org> References: <20220207103804.053675072@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Rix commit 37b4599547e324589e011c20f74b021d6d25cb7f upstream. Clang static analysis reports this problem ioctl.c:3333:8: warning: 3rd function call argument is an uninitialized value ret = exclop_start_or_cancel_reloc(fs_info, cancel is only set in one branch of an if-check and is always used. So initialize to false. Fixes: 1a15eb724aae ("btrfs: use btrfs_get_dev_args_from_path in dev removal ioctls") Reviewed-by: Filipe Manana Reviewed-by: Anand Jain Signed-off-by: Tom Rix Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3310,7 +3310,7 @@ static long btrfs_ioctl_rm_dev(struct fi struct block_device *bdev = NULL; fmode_t mode; int ret; - bool cancel; + bool cancel = false; if (!capable(CAP_SYS_ADMIN)) return -EPERM;