diff --git a/src/utils/utils_req.c b/src/utils/utils_req.c index d8d00e2..85c69c2 100644 --- a/src/utils/utils_req.c +++ b/src/utils/utils_req.c @@ -263,12 +263,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) @@ -282,6 +281,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)