summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2023-11-20 13:25:03 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-12-20 17:01:56 +0100
commit4a4bba9f0470d0cb6afd8c8e880b04567585f542 (patch)
tree8d72bf17c08047f7c1d1c01dba3c7b5570709a03
parent286918928ed7094d53e6fd08513e4a3f1a09f1d0 (diff)
downloadlinux-stable-4a4bba9f0470d0cb6afd8c8e880b04567585f542.tar.gz
linux-stable-4a4bba9f0470d0cb6afd8c8e880b04567585f542.tar.bz2
linux-stable-4a4bba9f0470d0cb6afd8c8e880b04567585f542.zip
bcache: avoid NULL checking to c->root in run_cache_set()
[ 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 <colyli@suse.de> Link: https://lore.kernel.org/r/20231120052503.6122-11-colyli@suse.de Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/md/bcache/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 93791e46b1e8..1e677af38521 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);