Add missed mutex_unlock when return on error is occurred 91/292191/1
authorjinbong, Lee <jinbong.lee@samsung.com>
Fri, 28 Apr 2023 10:13:03 +0000 (19:13 +0900)
committerjinbong, Lee <jinbong.lee@samsung.com>
Fri, 28 Apr 2023 10:13:03 +0000 (19:13 +0900)
  - source_mutex unlock is needed when creating eventfd is failed

Change-Id: Ic2563f7bc89ec28b2bf8db12c6087cbf86acedf9

src/tpl_utils_gthread.c

index 4d4a152..5cf1a80 100644 (file)
@@ -273,6 +273,7 @@ tpl_gsource_create(tpl_gthread *thread, void *data, int fd,
                new_gsource->fd = eventfd(0, EFD_CLOEXEC);
                if (new_gsource->fd < 0) {
                        TPL_ERR("Failed to create eventfd. errno(%d)", errno);
+                       g_mutex_unlock(&new_gsource->source_mutex);
                        g_source_unref(&new_gsource->gsource);
                        return NULL;
                }