From d5ff317360aac755a0952e1a603ab276d9e4ea0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20J=2E=20Saraiva?= Date: Thu, 28 Mar 2024 05:00:38 +0000 Subject: [PATCH] Fix missing unlock in tc_alloc. --- unstable/tcb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unstable/tcb.c b/unstable/tcb.c index 85410d50c..9ba0f23ec 100644 --- a/unstable/tcb.c +++ b/unstable/tcb.c @@ -392,8 +392,10 @@ cpu_tc_t *tc_alloc(cpu_gen_t *cpu,m_uint64_t vaddr,m_uint32_t exec_state) tc = tsg->tc_free_list; tsg->tc_free_list = tc->sc_next; } else { - if (!(tc = malloc(sizeof(*tc)))) + if (!(tc = malloc(sizeof(*tc)))) { + TSG_UNLOCK(tsg); return NULL; + } } TSG_UNLOCK(tsg);