Commit 9ec6dc68 authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by Treehugger Robot
Browse files

ANDROID: fix dmabuf accounting deadlock issue



dmabu accounting code uses two main locks: dmabuf_rec_reloads.lock to
control access to dmabuf record preloads and dmabuf_info->lock to
control access to dmabuf_info fields. If both these locks should be
held then the locking order should always be dmabuf_rec_reloads.lock
first and then dmabuf_info->lock. However dma_buf_unaccount_task()
violates this rule by taking dmabuf_info->lock and then locking
dmabuf_rec_reloads.lock indirectly via free_task_dmabuf_record() call.
This can result in a deadlock. Fix it by calling free_task_dmabuf_record()
after dmabuf_info->lock is released.

Bug: 434747237
Bug: 424646615
Change-Id: Ie4bead2b1952659e0009441cff95b26fed7267f8
Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
parent c4165adf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment