summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-08-28 07:31:11 +0800
committerJens Axboe <axboe@kernel.dk>2018-08-27 19:16:06 -0600
commit62d2a1940709198a522a43ff8be8b8f6b3654dec (patch)
treedb9237beb8b83d40069a2090b263211dc792945e /block
parent46cb52ad414ac829680d0bb8cc7090ac2b577ca7 (diff)
block: remove unnecessary condition check
kmem_cache_destroy() can handle NULL pointer correctly, so there is no need to check e->icq_cache before calling kmem_cache_destroy(). Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/elevator.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/elevator.c b/block/elevator.c
index 5ea6e7d600e4..6a06b5d040e5 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -895,8 +895,7 @@ int elv_register(struct elevator_type *e)
spin_lock(&elv_list_lock);
if (elevator_find(e->elevator_name, e->uses_mq)) {
spin_unlock(&elv_list_lock);
- if (e->icq_cache)
- kmem_cache_destroy(e->icq_cache);
+ kmem_cache_destroy(e->icq_cache);
return -EBUSY;
}
list_add_tail(&e->list, &elv_list);