From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0260FC43334 for ; Fri, 3 Jun 2022 17:44:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345114AbiFCRoh (ORCPT ); Fri, 3 Jun 2022 13:44:37 -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 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)) {