mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
video: tegra: nvmap: Clear handle->owner on release
A struct nvmap_handle may be shared by multiple clients. If the original client (the handle "owner") is destroyed, but the handle is still referenced by other clients, h->owner points to freed memory. To prevent this, clear h->owner when the owner frees its reference to that struct nvmap_handle. Change-Id: I54722091568ce2058f5988e5f6e00e68605a8100 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
This commit is contained in:
committed by
Rebecca Schultz Zavin
parent
c0132a6dfe
commit
0e3fe9b394
@@ -379,6 +379,9 @@ void nvmap_free_handle_id(struct nvmap_client *client, unsigned long id)
|
||||
while (pins--)
|
||||
nvmap_unpin_handles(client, &ref->handle, 1);
|
||||
|
||||
if (h->owner == client)
|
||||
h->owner = NULL;
|
||||
|
||||
kfree(ref);
|
||||
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user