linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Neal Liu <neal_liu@aspeedtech.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>,
	linux-aspeed@lists.ozlabs.org, linux-usb@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2] usb: gadget: aspeed_udc: unlock on error in ast_udc_ep_queue()
Date: Sat, 18 Jun 2022 11:54:53 +0300	[thread overview]
Message-ID: <Yq2S3aF0MPChLD/e@kili> (raw)
In-Reply-To: <Yq2SvM2bbrtSd1H9@kili>

Call spin_unlock_irqrestore(&udc->lock, flags); before returning an
error code.

Fixes: 055276c13205 ("usb: gadget: add Aspeed ast2600 udc driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/usb/gadget/udc/aspeed_udc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
index 77376ae04224..4dead40895dd 100644
--- a/drivers/usb/gadget/udc/aspeed_udc.c
+++ b/drivers/usb/gadget/udc/aspeed_udc.c
@@ -663,7 +663,8 @@ static int ast_udc_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
 	if (ep->ep.desc == NULL) {
 		if ((req->req.dma % 4) != 0) {
 			dev_warn(dev, "EP0 req dma alignment error\n");
-			return -ESHUTDOWN;
+			rc = -ESHUTDOWN;
+			goto end;
 		}
 
 		ast_udc_ep0_queue(ep, req);
-- 
2.35.1


  reply	other threads:[~2022-06-18  8:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-18  8:54 [PATCH 1/2] usb: gadget: aspeed_udc: cleanup loop in ast_dma_descriptor_setup() Dan Carpenter
2022-06-18  8:54 ` Dan Carpenter [this message]
2022-06-21  9:24   ` [PATCH 2/2] usb: gadget: aspeed_udc: unlock on error in ast_udc_ep_queue() Neal Liu
2022-06-22  5:25 ` [PATCH 1/2] usb: gadget: aspeed_udc: cleanup loop in ast_dma_descriptor_setup() Neal Liu

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=Yq2S3aF0MPChLD/e@kili \
    --to=dan.carpenter@oracle.com \
    --cc=andrew@aj.id.au \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joel@jms.id.au \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=neal_liu@aspeedtech.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).