summaryrefslogtreecommitdiffstats
path: root/block/elevator.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-08-27 19:31:11 -0400
committerJens Axboe <axboe@kernel.dk>2018-08-27 21:16:06 -0400
commit62d2a1940709198a522a43ff8be8b8f6b3654dec (patch)
treedb9237beb8b83d40069a2090b263211dc792945e /block/elevator.c
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/elevator.c')
-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)
895 spin_lock(&elv_list_lock); 895 spin_lock(&elv_list_lock);
896 if (elevator_find(e->elevator_name, e->uses_mq)) { 896 if (elevator_find(e->elevator_name, e->uses_mq)) {
897 spin_unlock(&elv_list_lock); 897 spin_unlock(&elv_list_lock);
898 if (e->icq_cache) 898 kmem_cache_destroy(e->icq_cache);
899 kmem_cache_destroy(e->icq_cache);
900 return -EBUSY; 899 return -EBUSY;
901 } 900 }
902 list_add_tail(&e->list, &elv_list); 901 list_add_tail(&e->list, &elv_list);