Commit 93853d6c authored by Tristan Gingold's avatar Tristan Gingold

fw/fd: avoid NULL access.

parent 45f6dd07
......@@ -367,8 +367,6 @@ static void update_latency_stats(struct pulse_queue_entry *pq_ent)
volatile uint32_t dummy = lr_readl (MT_CPU_LR_REG_TAI_SEC);
int latency;
if(!rule)
return;
latency = lr_readl (MT_CPU_LR_REG_TAI_CYCLES) - pq_ent->origin_cycles;
if (latency < 0)
latency += 125 * 1000 * 1000;
......@@ -445,7 +443,8 @@ static void do_output (struct wrtd_out_channel *out)
drop_trigger(out, pq_ent, q, WRTD_MISS_TIMEOUT);
} else {
out->stats.last_executed = pq_ent->trig;
pq_ent->rule->hits ++;
if (pq_ent->rule)
pq_ent->rule->hits++;
pulse_queue_pop(q);
out->stats.hits++;
out->priv.idle = 1;
......@@ -504,7 +503,8 @@ static void do_output (struct wrtd_out_channel *out)
out->stats.last_programmed = *ts;
out->priv.idle = 0;
update_latency_stats (pq_ent);
if (pq_ent->rule != NULL)
update_latency_stats (pq_ent);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment