Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp88930iof; Sun, 5 Jun 2022 22:01:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlgli+YEMNQCPtvii6bDe1ZjRYvfOk58IAuiUS6EghoV2j/kgX+DZA64dxzUrC0I74PmAE X-Received: by 2002:a17:902:8693:b0:161:e28f:f85f with SMTP id g19-20020a170902869300b00161e28ff85fmr22751072plo.17.1654491701761; Sun, 05 Jun 2022 22:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654491701; cv=none; d=google.com; s=arc-20160816; b=RG5u7XaZkk4T1uqveIMfg59JiSPwPc6Aq8/czlhbFCUjLQb6EA7RcndcbYCTABeMXW 9ryhWunyi6gt9aJpF9eTgPkVW/IViigVrG1D49+Ri8MudxhvHbe+cPGMmjRiSjbaS7AA 0FtWJ2M60Ok16uOOZz4nIfkZGGmmNmFfuFXQcRY7q7xq1E0j5BrfQoeoxNwqnE5TaLi3 MX9HuiQzqNOLY7vtpzLey7lGPQq044/Ww2jBDrb0wFDjvbkIjbGPlek10ft/AcItj0pX MsSyt6+ZN+sVHLSp5dnuN3r8yAZN8Ayql2hrh2UBa42y4NqF3BA2l07iNFCm+mo0IIqm nm8Q== 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=xAM9DWfZJ2GIu7PpyBkHAjlzzHADNQVzciABiCK74vc=; b=nEv3jj15qDlpd9i5J28Eq+8fatQtXRYppyVGGnyNJ0T3mzovznnjSVCOG8HNPhKWDs XuE+E12TQsy5gyoo++VmvfSDJsBniRLmqeOw1eGPBh/vqEIikkHu3yNdrNJN2LjD9HaY RPyj6Q3n2v1f13nfAwxcdcNY5JuE8tWrVcDUCqQ5j+zkMl5wBlu8+CQPws3Z8Rq2M6P7 2umbsqATPoJcJeG1vmploCOE1bK34tLkNmF+zW78YOp9Pxl8ZJCbJsaLKUwT3gbBE7nG nZsXnR7o08CjBlgxMtXoabP38MAWeQF3QqeiYi37pamoyKFC545IwDUUNCFgGy8J3ZXz KqmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1D9ckzg6; 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 jd7-20020a170903260700b00162188be366si17846130plb.617.2022.06.05.22.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:01:41 -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=1D9ckzg6; 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 927E013326A; Sun, 5 Jun 2022 21:15:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345109AbiFCRof (ORCPT + 99 others); Fri, 3 Jun 2022 13:44:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344885AbiFCRnt (ORCPT ); Fri, 3 Jun 2022 13:43:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3982253A4E; Fri, 3 Jun 2022 10:42:19 -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 ams.source.kernel.org (Postfix) with ESMTPS id F18EFB82189; Fri, 3 Jun 2022 17:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61E3CC385A9; Fri, 3 Jun 2022 17:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278136; bh=TAFoB58GkJgcHsUaPVkQbIny7KMUv+5ZQHx316qJw2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1D9ckzg6Io4T1eeSskFq7rpzQdVbH0mh32mwTq08vT6uagU6lF04Wt2wO88x5XnCw oQxty0lAgTC0H6BW/sTqAZfBd442IxcnUnccPF3iusrdNVXKrr3QZUSoaVgh9KX1NV 9uuVgP7nveSZ0wUlHf1zdZNXPYZ+6qzWZZ72m9Ww= 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.19 21/30] dm integrity: fix error code in dm_integrity_ctr() Date: Fri, 3 Jun 2022 19:39:49 +0200 Message-Id: <20220603173815.718723788@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173815.088143764@linuxfoundation.org> References: <20220603173815.088143764@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 @@ -3565,8 +3565,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)) {