mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
video: tegra: nvmap: Fix INT32-C overflow defects
-dupes variable is decremented within the while loop after each call to nvmap_handle_put(ref->handle). -This prevents an infinite loop scenario where dupes remains greater than 0. JIRA: TMM-5724 Bug 4479044 Change-Id: Ideea8e05be4d175c5e78895eb5d76fed4b655968 Signed-off-by: Surbhi Singh <surbhis@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3258081 Reviewed-by: Ketan Patil <ketanp@nvidia.com> Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
@@ -276,11 +276,11 @@ static void destroy_client(struct nvmap_client *client)
|
|||||||
dma_buf_put(ref->handle->dmabuf);
|
dma_buf_put(ref->handle->dmabuf);
|
||||||
rb_erase(&ref->node, &client->handle_refs);
|
rb_erase(&ref->node, &client->handle_refs);
|
||||||
atomic_dec(&ref->handle->share_count);
|
atomic_dec(&ref->handle->share_count);
|
||||||
|
|
||||||
dupes = atomic_read(&ref->dupes);
|
dupes = atomic_read(&ref->dupes);
|
||||||
while (dupes--)
|
while (dupes > 0) {
|
||||||
nvmap_handle_put(ref->handle);
|
nvmap_handle_put(ref->handle);
|
||||||
|
dupes--;
|
||||||
|
}
|
||||||
kfree(ref);
|
kfree(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user