diff --git a/src/utils/utils_req.c b/src/utils/utils_req.c index 7448ea5..96e6a8c 100644 --- a/src/utils/utils_req.c +++ b/src/utils/utils_req.c @@ -264,12 +264,11 @@ void ocf_req_get(struct ocf_request *req) void ocf_req_put(struct ocf_request *req) { env_allocator *allocator; + ocf_queue_t queue = req->io_queue; if (env_atomic_dec_return(&req->ref_count)) return; - ocf_queue_put(req->io_queue); - OCF_DEBUG_TRACE(req->cache); if (!req->d2c && req->io_queue != req->cache->mngt_queue) @@ -283,6 +282,8 @@ void ocf_req_put(struct ocf_request *req) env_free(req->map); env_allocator_del(_ocf_req_get_allocator_1(req->cache), req); } + + ocf_queue_put(queue); } void ocf_req_clear_info(struct ocf_request *req)