From patchwork Mon Jun 21 15:22:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1495171 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=xtNIfJhT; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G7tbL6d0yz9sWk for ; Tue, 22 Jun 2021 01:23:42 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=nL7sKGf9DrLcqYteLXcskLrCLxSq+uvbF3VkZSt0I8A=; b=xtNIfJhTQHbpxv bmtMPen3fhiDTftmDhkU6m6NhcJxXIhvnc+fZW0koKTgKwtCpE0E+Db/xQSS/oar8RMRiFKXxEnPR /Bzbvn33t/kEPPL3vZxUrueai82iW0//norQM48zTExewVcSplnxmZ1G5lekxWJEdqXLrIqmFFiuy wVttMEoaw6RrY5Em7vsOqWzbQ3Dz4Jg3JhpgKU80bWiwURSkaIZEz9viLwdb0As4UX2Sjf0Q5dtWL W/B9yRg9/ayHf+1NIZdzSXKDGZYWS09SbytbXWTqBmsA7pMpaWusZvIrWOzmL0ERdhctzm9iTbvxO 1HckFR+TzkZoUhk3PMTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvLlK-003tt8-6S; Mon, 21 Jun 2021 15:22:58 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvLlH-003tsJ-Ar for linux-mtd@lists.infradead.org; Mon, 21 Jun 2021 15:22:56 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lvLlB-0001q5-GW; Mon, 21 Jun 2021 15:22:49 +0000 From: Colin King To: Richard Weinberger , Dan Carpenter , linux-mtd@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ubifs: Remove a redundant null check on pointer lp Date: Mon, 21 Jun 2021 16:22:49 +0100 Message-Id: <20210621152249.20901-1-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210621_082255_435330_405BF66E X-CRM114-Status: UNSURE ( 8.11 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Colin Ian King An earlier fix to replace an IS_ERR check on lp with a null check on lp didn't remove a following null check on lp. The second null check is redundant and can be removed. Content analysis details: (-5.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [91.189.89.112 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [91.189.89.112 listed in wl.mailspike.net] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Colin Ian King An earlier fix to replace an IS_ERR check on lp with a null check on lp didn't remove a following null check on lp. The second null check is redundant and can be removed. Addresses-Coverity: ("Logically dead code") Fixes: c770cd5190ba ("ubifs: fix an IS_ERR() vs NULL check") Signed-off-by: Colin Ian King --- fs/ubifs/gc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c index 7cc22d7317ea..465beea52176 100644 --- a/fs/ubifs/gc.c +++ b/fs/ubifs/gc.c @@ -899,8 +899,6 @@ int ubifs_gc_start_commit(struct ubifs_info *c) err = -ENOMEM; goto out; } - if (!lp) - break; idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS); if (!idx_gc) { err = -ENOMEM;