From 3f8fdffda7dee90d67764d2c0a854912a08b9690 Mon Sep 17 00:00:00 2001 From: Li Junru Date: Sun, 28 Apr 2024 18:53:27 +0800 Subject: [PATCH 1/2] fix(video): fix uninitialized value --- src/class/video/video_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/class/video/video_device.c b/src/class/video/video_device.c index 4e2f53bdc7..76fe4782c1 100644 --- a/src/class/video/video_device.c +++ b/src/class/video/video_device.c @@ -542,7 +542,8 @@ static bool _negotiate_streaming_parameters(videod_streaming_interface_t const * tusb_desc_cs_video_fmt_t const *fmt = _find_desc_format(tu_desc_next(vs), end, fmtnum); tusb_desc_cs_video_frm_t const *frm = _find_desc_frame(tu_desc_next(fmt), end, frmnum); - uint_fast32_t interval, interval_ms; + uint_fast32_t interval = 0; + uint_fast32_t interval_ms = 0; switch (request) { case VIDEO_REQUEST_GET_MAX: { From ff7f67d95b8996fe3c843b4b11034a06bbb9df05 Mon Sep 17 00:00:00 2001 From: Li Junru Date: Tue, 30 Apr 2024 15:16:20 +0800 Subject: [PATCH 2/2] fix(dcd_dwc2): error assest for endpoint close --- src/portable/synopsys/dwc2/dcd_dwc2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/portable/synopsys/dwc2/dcd_dwc2.c b/src/portable/synopsys/dwc2/dcd_dwc2.c index 020db70bf6..5bccde7d25 100644 --- a/src/portable/synopsys/dwc2/dcd_dwc2.c +++ b/src/portable/synopsys/dwc2/dcd_dwc2.c @@ -674,10 +674,10 @@ static bool dcd_edpt_counter_available(uint8_t rhport, uint8_t dir) static bool dcd_edpt_counter_release(uint8_t rhport, uint8_t dir) { if (dir) { - TU_ASSERT(dwc2_ep_counters[rhport].active_in == 0); // Check if number of opened EPs is not zero + TU_ASSERT(dwc2_ep_counters[rhport].active_in != 0); // Check if number of opened EPs is not zero dwc2_ep_counters[rhport].active_in--; // Decrease endpoint counter } else { - TU_ASSERT(dwc2_ep_counters[rhport].active_out == 0); + TU_ASSERT(dwc2_ep_counters[rhport].active_out != 0); dwc2_ep_counters[rhport].active_out--; } return true;