From: Coly Li Date: Mon, 20 Nov 2023 05:25:03 +0000 (+0800) Subject: bcache: avoid NULL checking to c->root in run_cache_set() X-Git-Tag: v5.15.144~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7020385effce2a3551060afe6ef63fcf367dbf31;p=thirdparty%2Fkernel%2Fstable.git 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 Link: https://lore.kernel.org/r/20231120052503.6122-11-colyli@suse.de Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 5ad83924d8e3b..8ec48d8a5821c 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -2024,7 +2024,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);