summaryrefslogtreecommitdiffstats
path: root/block/elevator.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-08-28 01:31:11 +0200
committerJens Axboe <axboe@kernel.dk>2018-08-28 03:16:06 +0200
commit62d2a1940709198a522a43ff8be8b8f6b3654dec (patch)
treedb9237beb8b83d40069a2090b263211dc792945e /block/elevator.c
parentata: ftide010: Add a quirk for SQ201 (diff)
downloadlinux-62d2a1940709198a522a43ff8be8b8f6b3654dec.tar.xz
linux-62d2a1940709198a522a43ff8be8b8f6b3654dec.zip
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)
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);