Skip to content

Commit 076fa20

Browse files
sudeep-hollagregkh
authored andcommitted
firmware: arm_ffa: Fix memory leak by freeing notifier callback node
[ Upstream commit a833d31 ] 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: <[email protected]> Reviewed-by: Jens Wiklander <[email protected]> Signed-off-by: Sudeep Holla <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9ff95ed commit 076fa20

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
@@ -1166,6 +1166,7 @@ update_notifier_cb(int notify_id, enum notify_type type, ffa_notifier_cb cb,
11661166
hash_add(drv_info->notifier_hash, &cb_info->hnode, notify_id);
11671167
} else {
11681168
hash_del(&cb_info->hnode);
1169+
kfree(cb_info);
11691170
}
11701171

11711172
return 0;

0 commit comments

Comments
 (0)