Simplify read/write start
When read or write is started with insuficcient encryption, and the encryption fails, it will either return immediate error GATT_NO_RESOURCES, or the operation will be enqueued. In case the enqueued operation fails again on the BTM_SetEncryption, no callback will never be called, and no operation error will be returned. The gatt_end_operation will never get called for the CLCB, and it will never be freed, causing memory leak. This patch fixes this by making sure that the call to gatt_security_check_start always consumes the CLCB - either by executing operation, queuing it, or returning error. This also ensures that if BTM_SetEncryption fails, it will always be handled the same way - by calling the callback. Test: manual Change-Id: Ibc20c1101cc7b5b6043e75df93b23a5b24b791e9
Loading
Please register or sign in to comment