[ovs-dev] ovs-rcu: Fix potential double free issue
diff mbox series

Message ID 20190625124214.55989-1-wang.li@139.com
State New
Headers show
  • [ovs-dev] ovs-rcu: Fix potential double free issue
Related show

Commit Message

Wang Li June 25, 2019, 12:42 p.m. UTC
From: Wang Li <wangli39@baidu.com>

If pthread_setspecific set value of the key to NULL, then it will trigger the
destructor function ovsrcu_thread_exit_cb to call ovsrcu_unregister__ implicitly,
so we have to remove it here to avoid potential double free issue.

Signed-off-by: Wang Li <wangli39@baidu.com>
 lib/ovs-rcu.c | 1 -
 1 file changed, 1 deletion(-)

diff mbox series

diff --git a/lib/ovs-rcu.c b/lib/ovs-rcu.c
index ebc8120f0..3adfe5c3f 100644
--- a/lib/ovs-rcu.c
+++ b/lib/ovs-rcu.c
@@ -134,7 +134,6 @@  ovsrcu_quiesce_start(void)
     perthread = pthread_getspecific(perthread_key);
     if (perthread) {
         pthread_setspecific(perthread_key, NULL);
-        ovsrcu_unregister__(perthread);