diff mbox series

usb: chipidea: udc: initialize bounced_size to avoid coverity warning

Message ID 20250114102815.2311956-1-xu.yang_2@nxp.com
State New
Headers show
Series usb: chipidea: udc: initialize bounced_size to avoid coverity warning | expand

Commit Message

Xu Yang Jan. 14, 2025, 10:28 a.m. UTC
The synopsys covertiy tool complains "Using uninitialized value
bounced_size." at some condition.

    sg_dma_len(sg) = min(sg_dma_len(sg), bounced_size);
                                         ^~~~~~~~~~~~
Although it can't happen, try remove the warning by initializing it.

Fixes: edfcc455c85c ("usb: chipidea: udc: create bounce buffer for problem sglist entries if possible")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
 drivers/usb/chipidea/udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 8a9b31fd5c89..8e496b7d940d 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -673,7 +673,7 @@  static int _hardware_enqueue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq)
 	struct ci_hdrc *ci = hwep->ci;
 	int ret = 0;
 	struct td_node *firstnode, *lastnode;
-	unsigned int bounced_size;
+	unsigned int bounced_size = 0;
 	struct scatterlist *sg;
 
 	/* don't queue twice */