diff options
author | Jin Wei <wei.a.jin@intel.com> | 2011-12-15 15:49:25 +0800 |
---|---|---|
committer | Jack Ren <jack.ren@intel.com> | 2012-02-23 17:37:58 +0800 |
commit | c5393b23f6b7837d3b775e447573180fac4923fc (patch) | |
tree | ef1204c0a0cf0ae2044f94beeb26e1a6d1465e9e | |
parent | f9c5afb1f9d8e615ab98774a10bbf117962db66d (diff) | |
download | bionic-c5393b23f6b7837d3b775e447573180fac4923fc.zip bionic-c5393b23f6b7837d3b775e447573180fac4923fc.tar.gz bionic-c5393b23f6b7837d3b775e447573180fac4923fc.tar.bz2 |
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 <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
-rwxr-xr-x | libc/arch-x86/bionic/__set_tls.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libc/arch-x86/bionic/__set_tls.c b/libc/arch-x86/bionic/__set_tls.c index e5e43b5..7ed4b01 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; } |