From 2b9fb3141cb10b8bbfa1a18a6aab42474988a636 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 19 Oct 2020 16:31:51 +0200 Subject: posix: Fix pthread_spin_unlock() Prevent a call to _SMP_lock_Stats_register_or_max_section_time(). This fixes a thread stack corruption in case RTEMS_PROFILING and RTEMS_SMP is enabled. Close #4157. --- cpukit/posix/src/pspinunlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpukit/posix') diff --git a/cpukit/posix/src/pspinunlock.c b/cpukit/posix/src/pspinunlock.c index ca36a5fc76..5c02012374 100644 --- a/cpukit/posix/src/pspinunlock.c +++ b/cpukit/posix/src/pspinunlock.c @@ -40,7 +40,7 @@ int pthread_spin_unlock( pthread_spinlock_t *lock ) #if defined(RTEMS_PROFILING) /* This is a hack to get around the lock profiling statistics */ unused_stats.total_section_time = 0; - unused_stats.max_section_time = 0; + unused_stats.max_section_time = UINT32_MAX; unused_context.stats = &unused_stats; unused_context.acquire_instant = 0; #endif -- cgit v1.2.3