forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
46cb52ad41
commit
62d2a19407
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user