From: Or Har-Toov <[email protected]>

resource_ctx_init() allocates ctx->resources via resources_alloc()
which calls calloc(). resource_ctx_fini() calls resources_free() to
free the list items inside the struct, but never frees the struct
itself.

Signed-off-by: Or Har-Toov <[email protected]>
Signed-off-by: Tariq Toukan <[email protected]>
---
 devlink/devlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 7a8be3ad9b6a..ba14c0056b1c 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -7441,6 +7441,7 @@ static int resource_ctx_init(struct resource_ctx *ctx, 
struct dl *dl)
 static void resource_ctx_fini(struct resource_ctx *ctx)
 {
        resources_free(ctx->resources);
+       free(ctx->resources);
 }
 
 struct dpipe_ctx {
-- 
2.44.0


Reply via email to