diff mbox series

[1/2] usb: cdns3: gadget: initialize link_trb as NULL

Message ID 20201103143929.8257-1-peter.chen@nxp.com (mailing list archive)
State Accepted
Commit 78e91588510919a0dc9bd48916e760c1ba5797d2
Headers show
Series [1/2] usb: cdns3: gadget: initialize link_trb as NULL | expand

Commit Message

Peter Chen Nov. 3, 2020, 2:39 p.m. UTC
There is an uninitialized variable "link_trb" usage at function cdns3_ep_run_transfer.
Fixed it by initialize "link_trb" as NULL.

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 4e218882eb5a ("usb: cdns3: gadget: improve the dump TRB operation
	at cdns3_ep_run_transfer")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/cdns3/gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 26232917197a..ec1730109fd8 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -1114,7 +1114,7 @@  static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
 	struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
 	struct cdns3_request *priv_req;
 	struct cdns3_trb *trb;
-	struct cdns3_trb *link_trb;
+	struct cdns3_trb *link_trb = NULL;
 	dma_addr_t trb_dma;
 	u32 togle_pcs = 1;
 	int sg_iter = 0;