Remove the logic that checks channel lock during __send_result() 52/300052/2
authorChanggyu Choi <changyu.choi@samsung.com>
Mon, 16 Oct 2023 07:51:21 +0000 (16:51 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Mon, 16 Oct 2023 08:02:14 +0000 (17:02 +0900)
Client channel can be invalid when calling __send_result() into the main thread.
This patch removes the use of invalid mutex in these cases.

Change-Id: I1635f78431187314003bb8f2e53804d7f9231dd1
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/aul_launch.c

index 675b964..b4a555c 100644 (file)
@@ -401,19 +401,13 @@ static struct aul_request_s *__create_request(int cmd, int clifd, bundle *b)
 
 static int __send_result(struct aul_request_s *req, int res)
 {
-       client_channel_t *channel;
        int ret;
 
        if (req->cmd != WIDGET_GET_CONTENT && req->clifd >= 0) {
-               channel = __find_client_channel(req->clifd);
-               if (!channel) {
+               if (__find_client_channel(req->clifd) == NULL)
                        _E("Failed to find client channel. fd(%d)", req->clifd);
-                       return -1;
-               }
 
-               g_rec_mutex_lock(&channel->mutex);
                ret = aul_sock_send_result_v2(req->clifd, res, false);
-               g_rec_mutex_unlock(&channel->mutex);
                if (ret < 0) {
                        _E("Failed to send result. cmd(%s:%d)",
                                        aul_cmd_convert_to_string(req->cmd),