summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2025-05-28 09:49:41 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-10 16:04:44 +0200
commit076fa20b4f5737c34921dbb152f9efceaee571b2 (patch)
tree11b7958800ab7ef25a80a3b52462cc84b72e045b
parent9ff95ed0371aec4d9617e478e9c69cde86cd7c38 (diff)
firmware: arm_ffa: Fix memory leak by freeing notifier callback node
[ Upstream commit a833d31ad867103ba72a0b73f3606f4ab8601719 ] Commit e0573444edbf ("firmware: arm_ffa: Add interfaces to request notification callbacks") adds support for notifier callbacks by allocating and inserting a callback node into a hashtable during registration of notifiers. However, during unregistration, the code only removes the node from the hashtable without freeing the associated memory, resulting in a memory leak. Resolve the memory leak issue by ensuring the allocated notifier callback node is properly freed after it is removed from the hashtable entry. Fixes: e0573444edbf ("firmware: arm_ffa: Add interfaces to request notification callbacks") Message-Id: <20250528-ffa_notif_fix-v1-1-5ed7bc7f8437@arm.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/firmware/arm_ffa/driver.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index 47751b2c057a..c0f3b7cdb6ed 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -1166,6 +1166,7 @@ update_notifier_cb(int notify_id, enum notify_type type, ffa_notifier_cb cb,
hash_add(drv_info->notifier_hash, &cb_info->hnode, notify_id);
} else {
hash_del(&cb_info->hnode);
+ kfree(cb_info);
}
return 0;