From c5393b23f6b7837d3b775e447573180fac4923fc Mon Sep 17 00:00:00 2001 From: Jin Wei Date: Thu, 15 Dec 2011 15:49:25 +0800 Subject: [PATCH] bionic/x86: fix one potential deadlock in __set_tls() Fix bug: Currently the mutex lock _tls_desc_lock is not released when __set_thread_area() fails. That will leads to the deadlock when __set_tls( ) is called later on. Change-Id: Iea3267cb0659971cba7766cbc3346f6924274f86 Signed-off-by: Jin Wei Signed-off-by: Jack Ren Signed-off-by: Bruce Beare --- libc/arch-x86/bionic/__set_tls.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libc/arch-x86/bionic/__set_tls.c b/libc/arch-x86/bionic/__set_tls.c index e5e43b591..7ed4b0152 100755 --- a/libc/arch-x86/bionic/__set_tls.c +++ b/libc/arch-x86/bionic/__set_tls.c @@ -83,6 +83,7 @@ int __set_tls(void *ptr) if (rc != 0) { /* could not set thread local area */ + pthread_mutex_unlock(&_tls_desc_lock); return -1; }