Skip to content

Commit 7d3d887

Browse files
committed
firmware: arm_ffa: Fix memory leak by freeing notifier callback node
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]>
1 parent 0ff41df commit 7d3d887

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)