From 68bd747c288ffd7a9735f21fbea54ac727d773c0 Mon Sep 17 00:00:00 2001 From: Srinivasarao Pathipati Date: Fri, 20 May 2022 16:55:31 +0530 Subject: [PATCH] haven: Fix memory leak If haven returns an error in response to a message sent over hh_rm_msgq, free connection->recv_buff prior to returning an error to the caller. Change-Id: Ia23dcbb6a5bdb3d7a037d537e7dcf61695991a66 Signed-off-by: Srinivasarao Pathipati --- drivers/virt/haven/hh_rm_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/virt/haven/hh_rm_core.c b/drivers/virt/haven/hh_rm_core.c index 551397120848..700923889e78 100644 --- a/drivers/virt/haven/hh_rm_core.c +++ b/drivers/virt/haven/hh_rm_core.c @@ -637,6 +637,7 @@ void *hh_rm_call(hh_rm_msgid_t message_id, pr_err("%s: Reply for seq:%d failed with RM err: %d\n", __func__, connection->seq, connection->reply_err_code); ret = ERR_PTR(hh_remap_error(connection->reply_err_code)); + kfree(connection->recv_buff); goto out; }