diff options
author | Coly Li <colyli@suse.de> | 2023-11-20 13:25:03 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-11-20 09:17:51 -0700 |
commit | 3eba5e0b2422aec3c9e79822029599961fdcab97 (patch) | |
tree | 0515f82c8098a0673f0a989df944086c049ab97a /drivers/md | |
parent | 31f5b956a197d4ec25c8a07cb3a2ab69d0c0b82f (diff) | |
download | linux-stable-3eba5e0b2422aec3c9e79822029599961fdcab97.tar.gz linux-stable-3eba5e0b2422aec3c9e79822029599961fdcab97.tar.bz2 linux-stable-3eba5e0b2422aec3c9e79822029599961fdcab97.zip |
bcache: avoid NULL checking to c->root in run_cache_set()
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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/bcache/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index c7ecc7058d77..bfe1685dbae5 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -2018,7 +2018,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); |