Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5821575f authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

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
parent 6253e1c6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment