From 15e776ca9497d51a6f7ce6e9fd63cd19d21ac0cd Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 3 May 2024 08:14:32 -0400 Subject: [PATCH] MT#55283 call redis_update without call lock held Change-Id: I273e5f9a395cca3c612aea62556c84d9ace03500 Warned-by: Coverity --- daemon/call.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/daemon/call.c b/daemon/call.c index f46d7056d..8901f2721 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -136,6 +136,7 @@ void call_make_own_foreign(call_t *c, bool foreign) { static void call_timer_iterator(call_t *c, struct iterator_helper *hlp) { unsigned int check; bool good = false; + bool do_update = false; bool has_srtp = false; struct packet_stream *ps; stream_fd *sfd; @@ -279,7 +280,7 @@ next: // update every 5 minutes if (has_srtp && rtpe_now.tv_sec - atomic64_get_na(&c->last_redis_update) > 60*5) - redis_update_onekey(c, rtpe_redis_write); + do_update = true; goto out; } @@ -305,6 +306,10 @@ delete: out: rwlock_unlock_r(&rtpe_config.config_lock); rwlock_unlock_r(&c->master_lock); + + if (do_update) + redis_update_onekey(c, rtpe_redis_write); + log_info_pop(); }