From 05a1f9ef3750c5f0a3189a099ba05fcbdf925f27 Mon Sep 17 00:00:00 2001 From: Chunho Lee Date: Wed, 30 Jun 2021 06:50:08 +0100 Subject: [PATCH] coverity: check timer opaque before dereferencing Actually we always set this correctly using the uv_timer_start() wrapper, so this is a false positive. But satisfy Coverity nonetheless. --- lib/plat/esp32/esp32-misc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/plat/esp32/esp32-misc.c b/lib/plat/esp32/esp32-misc.c index 65de064a4..acd3018e7 100644 --- a/lib/plat/esp32/esp32-misc.c +++ b/lib/plat/esp32/esp32-misc.c @@ -91,6 +91,7 @@ void esp32_uvtimer_cb(TimerHandle_t t) { struct timer_mapping *p = pvTimerGetTimerID(t); - p->cb(p->t); + if (p) + p->cb(p->t); }