commit | afa629bd917981859da5fd7500be8f22ec4442e6 | [log] [tgz] |
---|---|---|
author | Pavlin Radoslavov <pavlin@google.com> | Wed Jan 27 16:03:19 2016 -0800 |
committer | Pavlin Radoslavov <pavlin@google.com> | Wed Jan 27 16:03:19 2016 -0800 |
tree | 0cbc705321ff4710211be02da56ee055b9217bd7 | |
parent | d05eb79f16d09ac32e395d4411246d2c32f7cbba [diff] |
Allow alarm_cancel() on NULL timers Remove an assert that prevents using alarm_cancel() with NULL timers. Bug: 26831803 Change-Id: Ifd1476272b13a3f7fd5a0dbb57ee867cbfe2c2bb
diff --git a/system/osi/src/alarm.c b/system/osi/src/alarm.c index a00aacc..2ccdd4f 100644 --- a/system/osi/src/alarm.c +++ b/system/osi/src/alarm.c
@@ -260,7 +260,8 @@ void alarm_cancel(alarm_t *alarm) { assert(alarms != NULL); - assert(alarm != NULL); + if (!alarm) + return; pthread_mutex_lock(&monitor);