mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
firmware: arm_ffa: Fix memory leak by freeing notifier callback node
Commite0573444ed("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:e0573444ed("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>
This commit is contained in:
parent
19272b37aa
commit
a833d31ad8
|
|
@ -1284,6 +1284,7 @@ update_notifier_cb(struct ffa_device *dev, int notify_id, void *cb,
|
|||
hash_add(drv_info->notifier_hash, &cb_info->hnode, notify_id);
|
||||
} else {
|
||||
hash_del(&cb_info->hnode);
|
||||
kfree(cb_info);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user