ecore_drm2: Fix invalid free, remove useless goto, and don't create

more than one eina_thread_queue
This commit is contained in:
Christopher Michael 2022-11-08 07:49:34 -05:00
parent 3ab68831da
commit 1e4761291c
1 changed files with 3 additions and 6 deletions

View File

@ -181,7 +181,7 @@ _ecore_drm2_crtc_create(Ecore_Drm2_Device *dev, drmModeCrtcPtr dcrtc, uint32_t p
if (!crtc)
{
ERR("Could not allocate space for CRTC");
goto err;
return NULL;
}
crtc->id = dcrtc->crtc_id;
@ -193,10 +193,6 @@ _ecore_drm2_crtc_create(Ecore_Drm2_Device *dev, drmModeCrtcPtr dcrtc, uint32_t p
dev->crtcs = eina_list_append(dev->crtcs, crtc);
return crtc;
err:
free(crtc);
return NULL;
}
Eina_Bool
@ -211,6 +207,8 @@ _ecore_drm2_crtcs_create(Ecore_Drm2_Device *dev)
res = sym_drmModeGetResources(dev->fd);
if (!res) return EINA_FALSE;
thq = eina_thread_queue_new();
for (; i < res->count_crtcs; i++)
{
/* try to get this crtc from drm */
@ -221,7 +219,6 @@ _ecore_drm2_crtcs_create(Ecore_Drm2_Device *dev)
if (!crtc) goto err;
/* NB: Use an explicit thread to fill crtc atomic state */
thq = eina_thread_queue_new();
crtc->thread =
ecore_thread_feedback_run(_ecore_drm2_crtc_state_thread,
_ecore_drm2_crtc_state_thread_notify,