Mutex Unlock Corrected 71/211871/2
authorSamanway Dey <samanway.dey@samsung.com>
Thu, 11 Jul 2019 12:25:01 +0000 (17:55 +0530)
committerSudipto Bal <sudipto.bal@samsung.com>
Fri, 9 Aug 2019 12:55:15 +0000 (12:55 +0000)
 - For tizen BLE caleclient.c file, in function CALEAdapterScanResultCb(),
g_LEServerListMutex was placed in a wrong nested block, as a result even if
g_LEServerListMutex was not locked in some case, ittas being unlocked following
crash in IoTivity stack.
 - Hence, corrected it

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/538/commits/4e49610943156f45e6b0e7c2a0a9783ba5c2b94b
(cherry-picked from 4e49610943156f45e6b0e7c2a0a9783ba5c2b94b)

Change-Id: I9d76583346029f46ef7ad7ded4c850ca1feb4b06
Signed-off-by: Samanway Dey <samanway.dey@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient.c

index 084ea7d..df00ae1 100644 (file)
@@ -532,12 +532,13 @@ void CALEAdapterScanResultCb(int result, bt_adapter_le_device_scan_result_info_s
                     CADestroyLEDataList(&serverInfo->pendingDataList);
                     oc_mutex_unlock(g_LEServerListMutex);
                     return ;
-                 }
-             }
-         }
+                }
+            }
+        }
+        oc_mutex_unlock(g_LEServerListMutex);
     }
 
-    oc_mutex_unlock(g_LEServerListMutex);
+
     OIC_LOG(DEBUG, TAG, "OUT");
 }