Skip to content

Commit e4ed6ce

Browse files
committed
firmware: arm_ffa: Fix memory leak by freeing notifier callback node
JIRA: https://issues.redhat.com/browse/RHEL-102692 commit a833d31 Author: Sudeep Holla <sudeep.holla@arm.com> Date: Wed, 28 May 2025 09:49:41 +0100 Commit e057344 ("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: e057344 ("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: Marcin Juszkiewicz <mjuszkiewicz@redhat.com> Message-ID: <288fea86f84b21092c0e2e76acb1d66f6940f820.1752653152.git.mjuszkiewicz@redhat.com> Message-ID: <e3c474b5739d12b76a9dc5a49e1a657e8d9422c4.1752659027.git.mjuszkiewicz@redhat.com>
1 parent ca5ed24 commit e4ed6ce

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/firmware/arm_ffa/driver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,7 @@ update_notifier_cb(struct ffa_device *dev, int notify_id, void *cb,
12841284
hash_add(drv_info->notifier_hash, &cb_info->hnode, notify_id);
12851285
} else {
12861286
hash_del(&cb_info->hnode);
1287+
kfree(cb_info);
12871288
}
12881289

12891290
return 0;

0 commit comments

Comments
 (0)