From 3ebcd045b5994b1f41b9e13ac4e24a487572df28 Mon Sep 17 00:00:00 2001 From: Brennan Ashton Date: Sat, 21 Nov 2020 18:53:57 -0800 Subject: [PATCH] usb: Do not try to print verbose trace when disabled Right now if usb tracing is enabled but verbose is disabled a debug assert will be triggered when ever a verbose trace point is hit. Instead of trying to print the NULL message, just return early. Signed-off-by: Brennan Ashton --- drivers/usbhost/usbhost_trace.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usbhost/usbhost_trace.c b/drivers/usbhost/usbhost_trace.c index bc9963893c..e6c16944ba 100644 --- a/drivers/usbhost/usbhost_trace.c +++ b/drivers/usbhost/usbhost_trace.c @@ -170,6 +170,7 @@ void usbhost_trace_common(uint32_t event) } } } + leave_critical_section(flags); } #endif /* CONFIG_USBHOST_TRACE */ @@ -202,7 +203,10 @@ void usbhost_trace1(uint16_t id, uint32_t u23) /* Get the format associated with the trace */ fmt = usbhost_trformat1(id); - DEBUGASSERT(fmt); + if (fmt == NULL) + { + return; + } /* Just print the data using syslog() */ @@ -220,7 +224,10 @@ void usbhost_trace2(uint16_t id, uint8_t u7, uint16_t u16) /* Get the format associated with the trace */ fmt = usbhost_trformat2(id); - DEBUGASSERT(fmt); + if (fmt == NULL) + { + return; + } /* Just print the data using syslog() */