Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp102733iof; Sun, 5 Jun 2022 22:27:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjhHEc0lk8ufmf8+wGtq6DSOG6GlmDDM9qtywzMbCPwze/KFRLaOSctC6/RhqwiA6pQMBB X-Received: by 2002:a17:90b:1192:b0:1e2:da25:4095 with SMTP id gk18-20020a17090b119200b001e2da254095mr44605487pjb.240.1654493246844; Sun, 05 Jun 2022 22:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654493246; cv=none; d=google.com; s=arc-20160816; b=WfYJXPro8LBzs0bqkESDYVDcSY0om6aGFM7yLguhHeQy63boXap74gtLSlv36ggsIl E89dYWtuktOurWdljzHBR9WAfqglUXCCYMer94Yz06ICxLpS/Grh9hK1sO8DO+NkrXdl Bn0k4oELOzGZYv5boK874jogKAwnbGdUF7VtnNHL2qrh3mE5QLTVJ7KLOJ98TGm+r+B+ TWcLvEUH9hF5kCkrId8tnmENX7N2bmyewJ0+jg2QkYgEcdkKgLfwgjw1le5YaW4fyfgL UjyyJOPy2tPd4KQFCFW+BnHspxOVDFQ77SgmmpmV2dU86Y1FS0Uh2ZTYVdAWsmgTEDKf UK+w== 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=2r+x4/gRjDsXS2Q3IAgp8cqrMZEl1foEPcr3+rnfX9o=; b=CW6cFJJR1BMWumqd04yymf1aS+37x4flg5SoQPuhzE+fZIuj14WD5pgLeagz3ozgOx 42EhO/WkghTkVDtaQzwSxUj2KjAZqJOmYBaPlITJRkP9bBSaia3MuxVNvObZjucqYOvt yYzJkY5HoAxW5U9ZP8Qq9euGU00S7RYAtXuofr5Ff9frelLH/482W4rlLeipsAgudy3b fzYCXj8njnmdVto8AMNvu8JBZ7tjPIwcJ2vFEQaOAgZ5XAo9CJ/BWgGupDoraY+GjYn4 hO54VEe81Fs+t5KoiNNWbEjApJtqc4NUjunQfTqhrSR0h3fSkl8dIOdSxhdeU9+i4ebM r1Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qk5IaJhI; 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 12-20020a63000c000000b003fd5ae10492si7740314pga.476.2022.06.05.22.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:27:26 -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=Qk5IaJhI; 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 A28021E735A; Sun, 5 Jun 2022 21:28:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243930AbiFCSTo (ORCPT + 99 others); Fri, 3 Jun 2022 14:19:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348060AbiFCSGg (ORCPT ); Fri, 3 Jun 2022 14:06:36 -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 1DD7D5DD3A; Fri, 3 Jun 2022 10:59:44 -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 44F066158E; Fri, 3 Jun 2022 17:59:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43D1FC385A9; Fri, 3 Jun 2022 17:59:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654279142; bh=jRo0E2UCuPCv1JfLpdMudZFaAv6Om2hSVnmaYr/kXRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qk5IaJhIWTzVXOVE2jLUKzcnSV4GQOLRO03A1ROtGXU9ukoPnQnn62c3zcZOe4jTz Io9jgAAw8MmoZxfAux5GRtPzbq/o+Y/YEx+rMG9TvfdLXcI0+Ooox1NGDk+2D4cfD2 wFbE180SaaSQM7vCLAWe2lu16bVZKZsgLHzhY6bw= 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.18 39/67] dm integrity: fix error code in dm_integrity_ctr() Date: Fri, 3 Jun 2022 19:43:40 +0200 Message-Id: <20220603173821.860340294@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173820.731531504@linuxfoundation.org> References: <20220603173820.731531504@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 @@ -4494,8 +4494,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)) {