From 3bc2131918cec07309233e07a39792d170362299 Mon Sep 17 00:00:00 2001 From: ligd Date: Wed, 22 Jun 2022 22:38:19 +0800 Subject: [PATCH] irq_procfs: fix divide 0 error Signed-off-by: ligd --- sched/irq/irq_procfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sched/irq/irq_procfs.c b/sched/irq/irq_procfs.c index 3014073c55..ead5965aa0 100644 --- a/sched/irq/irq_procfs.c +++ b/sched/irq/irq_procfs.c @@ -206,6 +206,7 @@ static int irq_callback(int irq, FAR struct irq_info_s *info, * rate = * TICKS_PER_SEC / elapsed */ + elapsed = elapsed ? elapsed : 1; intpart = (unsigned int)((copy.count * TICK_PER_SEC) / elapsed); if (intpart >= 10000) {