From: Peter Chen <peter.chen@nxp.com>
To: pawell@cadence.com, rogerq@ti.com
Cc: balbi@kernel.org, linux-usb@vger.kernel.org, linux-imx@nxp.com,
	jun.li@nxp.com, Peter Chen <peter.chen@nxp.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH 1/2] usb: cdns3: gadget: initialize link_trb as NULL
Date: Tue,  3 Nov 2020 22:39:28 +0800	[thread overview]
Message-ID: <20201103143929.8257-1-peter.chen@nxp.com> (raw)
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 --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;
-- 
2.17.1
next             reply	other threads:[~2020-11-03 14:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 14:39 Peter Chen [this message]
2020-11-03 14:39 ` [PATCH 2/2] usb: cdns3: gadget: calculate TD_SIZE based on TD Peter Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=20201103143929.8257-1-peter.chen@nxp.com \
    --to=peter.chen@nxp.com \
    --cc=balbi@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=jun.li@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=pawell@cadence.com \
    --cc=rogerq@ti.com \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).