When pp, commit is the sync operation, cb_done() will be called at the line of
commit(). In this case, buffers will be freed in cb_done() before
LIST_FOR_EACH_ENTRY_SAFE(b, bb, &commit_buffer_list, commit_link) line done.
So commit_link should be deleted when freed.
When commit() successed, commit_link will be deleted twice. So we need to use
LIST_DELINIT instead of LIST_DEL
Change-Id: I6a09878e1eae49d31eb3f3626e005a3ae10841d8
if ((capture_buffer = _tdm_capture_find_tbm_buffer(&private_capture->buffer_list, buffer))) {
LIST_DEL(&capture_buffer->link);
+ LIST_DELINIT(&capture_buffer->commit_link);
_pthread_mutex_unlock(&private_display->lock);
if (private_capture->done_func)
TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
LIST_FOR_EACH_ENTRY_SAFE(b, bb, &commit_buffer_list, commit_link) {
- LIST_DEL(&b->commit_link);
+ LIST_DELINIT(&b->commit_link);
if (!_tdm_capture_find_buffer(&private_capture->buffer_list, b))
continue;
if ((pp_buffer = _tdm_pp_find_tbm_buffers(&private_pp->buffer_list, src, dst))) {
LIST_DEL(&pp_buffer->link);
+ LIST_DELINIT(&pp_buffer->commit_link);
_pthread_mutex_unlock(&private_display->lock);
if (private_pp->done_func)
TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
LIST_FOR_EACH_ENTRY_SAFE(b, bb, &commit_buffer_list, commit_link) {
- LIST_DEL(&b->commit_link);
+ LIST_DELINIT(&b->commit_link);
if (!_tdm_pp_find_buffer(&private_pp->buffer_list, b))
continue;