Move the resource lock into the handles lock at destroy 97/238097/4 accepted/tizen/unified/20200713.094451 submit/tizen/20200710.025458
authorYoungHun Kim <yh8004.kim@samsung.com>
Wed, 8 Jul 2020 10:53:42 +0000 (19:53 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Thu, 9 Jul 2020 01:18:48 +0000 (10:18 +0900)
 - In order to prevent for possible issues, the missing
   mutex lock of the common implementation part is added

Change-Id: I6e09cca64b9dc301efeb42002d20581818fcd4a0

src/lib/mm_resource_manager_priv.c

index 3115dbb..8c430d1 100644 (file)
@@ -205,13 +205,13 @@ int _mm_resource_manager_destroy(mm_resource_manager_h rm)
        __mm_resource_handles_lock();
        MM_RESOURCE_MANAGER_CHECK(handle);
        g_ptr_array_remove_fast(handles, handle);
+       __mm_resources_lock(handle);
        __mm_resource_handles_unlock();
 
        id = handle->id;
 
        MM_RM_INFO("RM #%"PRIu64" will be destroyed", _mm_rm_hash64(id));
 
-       __mm_resources_lock(handle);
        ret = __dbus_destroy(handle);
        if (ret != MM_RESOURCE_MANAGER_ERROR_NONE)
                MM_RM_ERROR("Dbus destroy request failed 0x%x", ret);