From: Mathieu Desnoyers Date: Tue, 30 Aug 2011 01:16:23 +0000 (-0400) Subject: Fix range of sem_count X-Git-Tag: v1.9.1~210 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=56cd7e2fe3fd32cb212d0e7976a6bae09ff4948c;p=lttng-ust.git Fix range of sem_count Signed-off-by: Mathieu Desnoyers --- diff --git a/libust/lttng-ust-comm.c b/libust/lttng-ust-comm.c index 9400b6b8..c5a3064a 100644 --- a/libust/lttng-ust-comm.c +++ b/libust/lttng-ust-comm.c @@ -217,6 +217,9 @@ int handle_register_done(struct sock_info *sock_info) if (sock_info->constructor_sem_posted) return 0; sock_info->constructor_sem_posted = 1; + if (uatomic_read(&sem_count) <= 0) { + return 0; + } ret = uatomic_add_return(&sem_count, -1); if (ret == 0) { ret = sem_post(&constructor_wait);