From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EE3D5BF8F; Mon, 18 Dec 2023 14:03:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BaC0THLc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A332DC433C7; Mon, 18 Dec 2023 14:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1702908210; bh=AzMo496lPGkgqUaGpXdqRW9BUkAQE2dWDuKKpkZqSj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BaC0THLcBHfHsSWgFp35eCK6mKXTGxfNWYDotaeCvuemkTE7oYg5XxRzY9y/SP77H OAtPBNNVBohK6E2RCzIdA076RjytBxX8gQcyKbEDQXf+K6JF19h2VrJZfuazkVvIDX PCBGlEXoia58L86GT6n+KIjjE7SaP2Fg9NJZgBMQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Coly Li , Jens Axboe , Sasha Levin Subject: [PATCH 6.6 094/166] bcache: avoid NULL checking to c->root in run_cache_set() Date: Mon, 18 Dec 2023 14:51:00 +0100 Message-ID: <20231218135109.199908863@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218135104.927894164@linuxfoundation.org> References: <20231218135104.927894164@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Coly Li [ Upstream commit 3eba5e0b2422aec3c9e79822029599961fdcab97 ] In run_cache_set() after c->root returned from bch_btree_node_get(), it is checked by IS_ERR_OR_NULL(). Indeed it is unncessary to check NULL because bch_btree_node_get() will not return NULL pointer to caller. This patch replaces IS_ERR_OR_NULL() by IS_ERR() for the above reason. Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20231120052503.6122-11-colyli@suse.de Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/md/bcache/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 93791e46b1e8f..1e677af385211 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -2017,7 +2017,7 @@ static int run_cache_set(struct cache_set *c) c->root = bch_btree_node_get(c, NULL, k, j->btree_level, true, NULL); - if (IS_ERR_OR_NULL(c->root)) + if (IS_ERR(c->root)) goto err; list_del_init(&c->root->list); -- 2.43.0