Merge pull request #473 from robertbaldyga/deallocate-request-properly

ocf_request: Deallocate request with separately allocated map properly
This commit is contained in:
Robert Baldyga 2021-03-19 10:31:07 +01:00 committed by GitHub
commit 5f77db5c85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,8 +204,10 @@ void ocf_req_put(struct ocf_request *req)
if (!req->d2c && req->io_queue != req->cache->mngt_queue)
ocf_refcnt_dec(&req->cache->refcnt.metadata);
if (!env_mpool_del(req->cache->owner->resources.req, req,
req->core_line_count)) {
if (req->map == req->__map) {
env_mpool_del(req->cache->owner->resources.req, req,
req->core_line_count);
} else {
env_free(req->map);
env_mpool_del(req->cache->owner->resources.req, req, 1);
}