summaryrefslogtreecommitdiff
path: root/osi
diff options
context:
space:
mode:
authorPavlin Radoslavov <pavlin@google.com>2016-01-27 16:03:19 -0800
committerPavlin Radoslavov <pavlin@google.com>2016-01-27 16:03:19 -0800
commitdd7aaec9e8ccfeee5cd3f3a5caa1cc35d7870bde (patch)
treed847201eae4e204528ddbfd4e4d8f565b77e9ab7 /osi
parentda35bbce704acff55b9748264106162d33a7ff2a (diff)
downloadandroid-system-bt-dd7aaec9e8ccfeee5cd3f3a5caa1cc35d7870bde.tar.gz
android-system-bt-dd7aaec9e8ccfeee5cd3f3a5caa1cc35d7870bde.tar.xz
Allow alarm_cancel() on NULL timers
Remove an assert that prevents using alarm_cancel() with NULL timers. Bug: 26831803 Change-Id: Ifd1476272b13a3f7fd5a0dbb57ee867cbfe2c2bb
Diffstat (limited to 'osi')
-rw-r--r--osi/src/alarm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/osi/src/alarm.c b/osi/src/alarm.c
index a00aacc..2ccdd4f 100644
--- a/osi/src/alarm.c
+++ b/osi/src/alarm.c
@@ -260,7 +260,8 @@ static void alarm_set_internal(alarm_t *alarm, period_ms_t period,
void alarm_cancel(alarm_t *alarm) {
assert(alarms != NULL);
- assert(alarm != NULL);
+ if (!alarm)
+ return;
pthread_mutex_lock(&monitor);