From a955f70978f702fd9fbc2f6c9adc73b061aa7029 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Wed, 26 Mar 2025 15:42:53 +0100 Subject: [PATCH] Track allocation size for D2C requests Otherwise the D2C requests can't be returned to the proper memory pool, which effectively leds to a memory leak Signed-off-by: Michal Mielewczyk --- src/ocf_request.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ocf_request.c b/src/ocf_request.c index 9b7ce4d..4e3abe9 100644 --- a/src/ocf_request.c +++ b/src/ocf_request.c @@ -170,11 +170,14 @@ static inline struct ocf_request *ocf_req_new_d2c(ocf_queue_t queue, { ocf_cache_t cache = ocf_core_get_cache(core); struct ocf_request *req; + uint32_t request_size = 1; - req = env_mpool_new(cache->owner->resources.req, 1); + req = env_mpool_new(cache->owner->resources.req, request_size); if (unlikely(!req)) return NULL; + req->alloc_core_line_count = request_size; + ocf_req_init(req, cache, queue, core, addr, bytes, rw); req->d2c = true;