Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp132335iof; Sun, 5 Jun 2022 23:19:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZkDWj8LK9MIkZZ4R6TxwBtslE4umBC4pMr25uQRlFSximjxX9yS+DV8/DOwNA+NN7XsF2 X-Received: by 2002:a17:90a:4a03:b0:1df:4583:cb26 with SMTP id e3-20020a17090a4a0300b001df4583cb26mr59623055pjh.173.1654496352427; Sun, 05 Jun 2022 23:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654496352; cv=none; d=google.com; s=arc-20160816; b=d1ShnxMopVD21rSGH76OsrcQ+vQdVA1GGMb42BiK8AEgOrPCD1al+EzCLA5q7WLz05 5AvyJTBO//CboDSHWvuZFqsBMLKR9xEtDEZc+Lf1R8baYCwRLGY1W4D6OnROALJrV8J/ RTwl430KZG/jGOZJupBScD2M51i70zmOGZSUZVEs8cpkk0IZ292sSlbSjAgvDyTaqep8 1/jDSjaZ1yxOT4ySpdRHyqS+mkbwfFNbKhpEl5mS8yFIDMbSsMbnLp7OY283ciau44hF ucuxBumT9dtrj3cGH1TEr3hGEyRPhWWJ3baUjFh9mK5ccTqYWNdQGtT92wda7poLc8iU IB1w== 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=CCnWfhl5KrF/K0Z1EWPLc5XxU0aksT9UzV22Ngpdw0k=; b=vAUSwauDmunkKcCT6rJAl6o+C1qxdk+ET3ZZlPW+LBHipsLyDW6R3X0uBkPNkGcgjv 94vX1zwxoKWiQQOmy5EMlQcvReNxUZOq9brlGIYl6LhYy32JvUG1yjKHEnNx73w++lvK TFMFE/QfnEY9f3pcF6YC2AmD0rpBMLK56qlBnIeinNOXCCh4zEi7DxCc1waHAkAUvZ3u vawK0FmIIpSOuiLIopGCIBOKvSIfuAUzL+h6wbSKUJ3nTM3T7Pu7NgPVdM7WbmulVpBB 4s63XnFnMZB626ZrYtohW6Bbf7UXt02vpI58YA62RioQ1XlGJ9p/3X6tvYjZ5XgJSeq6 GXfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tW5EftI0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d18-20020a630e12000000b003fddd12eb2asi942698pgl.766.2022.06.05.23.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:19:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tW5EftI0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4C4C5102761; Sun, 5 Jun 2022 21:58:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345445AbiFCRtq (ORCPT + 99 others); Fri, 3 Jun 2022 13:49:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345362AbiFCRsN (ORCPT ); Fri, 3 Jun 2022 13:48:13 -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 378BA54188; Fri, 3 Jun 2022 10:45:05 -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 BCC3460A0F; Fri, 3 Jun 2022 17:45:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C16DEC385A9; Fri, 3 Jun 2022 17:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278304; bh=McbMbDm5n1vM5bMSXRjPzQihuWBuTHSYTtFHdq3qsro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tW5EftI0hnelnX6co6/IXHJYrCfrwIBuOuBZOP7pp7hlYmJEjKEbB2D+3KBKQ7mBw MBvT42loB0CtShxEpiA1ODcgRNrRMIzBjP1bJJIV8eVswDQ3K5qz20Em/rdv/mh04t XdkkPyMJPTMs9YrEWB/c2blx7sohxku6pdu6fQwY= 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 5.4 23/34] dm integrity: fix error code in dm_integrity_ctr() Date: Fri, 3 Jun 2022 19:43:19 +0200 Message-Id: <20220603173816.666898118@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173815.990072516@linuxfoundation.org> References: <20220603173815.990072516@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 @@ -4149,8 +4149,6 @@ try_smaller_buffer: } if (should_write_sb) { - int r; - init_journal(ic, 0, ic->journal_sections, 0); r = dm_integrity_failed(ic); if (unlikely(r)) {