msm: vidc: Avoid memset of list elements in the buffer entry.

- Due to race condition between free buffer and flush output buffers,
  invalid buffer is getting accessed sometimes.
- Reset all the members in buffer entry except list elements.

(cherry picked from commit 8105df366cf6b9f1ddbc15d561fb6a5f12540416)
CRs-Fixed: 411197

Change-Id: Id95037f57d7fe4bc88b96f187953194ec838d63b
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
This commit is contained in:
Srinu Gorle 2012-11-07 01:19:06 +05:30 committed by Stephen Boyd
parent d4bc4c74ff
commit 6359f576ab

View file

@ -784,7 +784,11 @@ u32 vcd_free_one_buffer_internal(
buf_pool->allocated--; buf_pool->allocated--;
} }
memset(buf_entry, 0, sizeof(struct vcd_buffer_entry)); buf_entry->valid = buf_entry->allocated = buf_entry->in_use = 0;
buf_entry->alloc = buf_entry->virtual = buf_entry->physical = NULL;
buf_entry->sz = 0;
memset(&buf_entry->frame, 0, sizeof(struct vcd_frame_data));
buf_pool->validated--; buf_pool->validated--;
if (buf_pool->validated == 0) if (buf_pool->validated == 0)
vcd_free_buffer_pool_entries(buf_pool); vcd_free_buffer_pool_entries(buf_pool);