Should fix some issues we're seeing. And use REALLOC instead of realloc.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
cnd_broadcast(&task->finish);
}
mtx_unlock(&pool->m);
- free(lmem.local_mem_ptr);
+ FREE(lmem.local_mem_ptr);
return 0;
}
cnd_destroy(&pool->new_work);
mtx_destroy(&pool->m);
- free(pool);
+ FREE(pool);
}
struct lp_cs_tpool_task *
mtx_unlock(&pool->m);
cnd_destroy(&task->finish);
- free(task);
+ FREE(task);
*task_handle = NULL;
}
memset(&thread_data, 0, sizeof(thread_data));
if (lmem->local_size < job_info->req_local_mem) {
+ lmem->local_mem_ptr = REALLOC(lmem->local_mem_ptr, lmem->local_size,
+ job_info->req_local_mem);
lmem->local_size = job_info->req_local_mem;
- lmem->local_mem_ptr = realloc(lmem->local_mem_ptr, lmem->local_size);
}
thread_data.shared = lmem->local_mem_ptr;