Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp97841iof; Sun, 5 Jun 2022 22:17:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqHEPNZ2mrj2ayG3AvbLOSTux+gLdWym07WR7Ma4DtYKHktR91pMsQiCXwD6YI9zlYkNBn X-Received: by 2002:a17:90a:ab90:b0:1da:375f:2f44 with SMTP id n16-20020a17090aab9000b001da375f2f44mr24490774pjq.33.1654492642973; Sun, 05 Jun 2022 22:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654492642; cv=none; d=google.com; s=arc-20160816; b=bYS0L+i/rL3Sx7FY1lBMB+N2V1tJIY4iBZcin2y9mL7GtCtXNz4W+BvBYDUZQdwcox owT8dfkD0QZmiAMDe8lnFMdg2G3DbkS6c4qtktWAVNjNOEZd2X8cVV41cXQNlBnY9HzN Y5Zbit4Fjy7f2Mjrmk1qM8S5HYgawc6UpNzoDhh6Mvo30wlc9SihA5L8e9teLk45cbTt KcjDrIa+plbFIj5jlA/jPicoKvjaoz1AYCeaJ9xXDbwtcnLbfv4HlZ8WctyvBfKPPl67 DNngKKd5g/qTuS+2vYqbrMSDxd4BZgsBmNn6RFu2kqU2gPIYZOk/Fb+Bahda/Exy0Rrt Nl1Q== 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=6GxPhrepr+2LJDmM+9BG+PmcyNIIgz7PNeMpTpXQf3U=; b=02PoFLR1Fh6RdjKncK5Mscmw4UBXiYlHzh2Mop/uQs14kXUBYggQrwh0BX/i0MABJI cJ64ItsZSVmQlr50l+SJYvdJ1uN+QcOCKwhL47LtTHxlZ+uXOeGo6Frh2VsxGYplQie1 Fu+1afa6onV7nqrQhXzE5OegsyStJPPqbJ61xEUYpIYLYHEySaiPemeZaB9zm6Wa7gP8 uG0AgnrnvjjY/yho5PToTsCqOfaG/Oh533bDGpsc4LXva+7xDO/F62NnU6NREE9MYJ4H kNAxGdqdVWmjxugpEETdSC6gU3IfsUL/gAAsWupnv/Iyj5mBt55o4dS6qYMvPXL1BdDl V1mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E5gKrqq7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u14-20020a056a00124e00b0051bb98abf24si19964200pfi.197.2022.06.05.22.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:17:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E5gKrqq7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D7CF17857A; Sun, 5 Jun 2022 21:22:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344618AbiFCRma (ORCPT + 99 others); Fri, 3 Jun 2022 13:42:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344756AbiFCRlz (ORCPT ); Fri, 3 Jun 2022 13:41:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EE6B53A51; Fri, 3 Jun 2022 10:41:15 -0700 (PDT) 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 A975361B00; Fri, 3 Jun 2022 17:41:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9955BC385A9; Fri, 3 Jun 2022 17:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278074; bh=nEEt0MjSOfaKM23Di3zdTZzjV4Q96cjTsIQFdDcNp/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E5gKrqq7HPbZxESwJQPR2fsnAHre+aQgy3g4fG24Ufyk0uf6J3Dz/8xShx2hQZc5+ 2lG6/9mShwFMbcubmTnwg0NS+hWwNlnlpiOI738FNJ5/7BsWLaXMTbOKU48hnfzIjr z0Zd20snTy2Ted0gMWLkrjBtyTJCW9Jht4SYonwg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Mikulas Patocka , Mike Snitzer Subject: [PATCH 4.14 16/23] dm integrity: fix error code in dm_integrity_ctr() Date: Fri, 3 Jun 2022 19:39:43 +0200 Message-Id: <20220603173814.856716104@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173814.362515009@linuxfoundation.org> References: <20220603173814.362515009@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Dan Carpenter commit d3f2a14b8906df913cb04a706367b012db94a6e8 upstream. The "r" variable shadows an earlier "r" that has function scope. It means that we accidentally return success instead of an error code. Smatch has a warning for this: drivers/md/dm-integrity.c:4503 dm_integrity_ctr() warn: missing error code 'r' Fixes: 7eada909bfd7 ("dm: add integrity target") Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-integrity.c | 2 -- 1 file changed, 2 deletions(-) --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -3156,8 +3156,6 @@ static int dm_integrity_ctr(struct dm_ta } if (should_write_sb) { - int r; - init_journal(ic, 0, ic->journal_sections, 0); r = dm_integrity_failed(ic); if (unlikely(r)) {