Fix: RCU read-side lock released too early in destroy_agent_app
[lttng-tools.git] / src / bin / lttng-sessiond / agent-thread.c
index 4c1457fe0df7a6fed32ce8141a1474e4cc2d531e..dbbdfde4ae08437f931039deaabb212593fe2e2b 100644 (file)
@@ -89,13 +89,13 @@ static void destroy_agent_app(int sock)
        rcu_read_lock();
        app = agent_find_app_by_sock(sock);
        assert(app);
-       rcu_read_unlock();
 
-       /* RCU read side lock is taken in this function call. */
+       /* RCU read side lock is assumed to be held by this function. */
        agent_delete_app(app);
 
        /* The application is freed in a RCU call but the socket is closed here. */
        agent_destroy_app(app);
+       rcu_read_unlock();
 }
 
 /*
This page took 0.025243 seconds and 4 git commands to generate.