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

Commit 7b3cbd16 authored by Stanley Tng's avatar Stanley Tng Committed by android-build-merger
Browse files

Merge "Assert if alarm callback is null"

am: c0e9ae39

Change-Id: I4241a172b6245bd7fdb4837c494882b8ea03416f
parents 7ea64b7b c0e9ae39
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -561,11 +561,16 @@ static void alarm_ready_generic(alarm_t* alarm,
  if (alarm == NULL) {
    return;  // The alarm was probably canceled
  }

  //
  // If the alarm is not periodic, we've fully serviced it now, and can reset
  // some of its internal state. This is useful to distinguish between expired
  // alarms and active ones.
  //
  if (!alarm->callback) {
    LOG(FATAL) << __func__
               << ": timer callback is NULL! Name=" << alarm->stats.name;
  }
  alarm_callback_t callback = alarm->callback;
  void* data = alarm->data;
  uint64_t deadline_ms = alarm->deadline_ms;