All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Faber <faber@faberman.de>
To: gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org
Subject: [PATCH] usb: gadget: composite: req->complete not set, using wrong callback for complete
Date: Sun, 19 Sep 2021 21:41:27 +0200	[thread overview]
Message-ID: <bded07a9-0549-569f-dcea-12e8bc7bf091@faberman.de> (raw)

In usb_composite_setup_continue, req->complete is not set, leaving the 
previous value untouched. After completion of the ep0 transaction, the 
UDC would then call whatever complete callback is set with the composite 
cdev as context, leading to all sorts of havoc.

Signed-off-by: Florian Faber <faber@faberman.de>

---
  drivers/usb/gadget/composite.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 504c1cbc255d..8d497be4be32 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -2518,6 +2518,7 @@ void usb_composite_setup_continue(struct 
usb_composite_dev *cdev)
  		DBG(cdev, "%s: Completing delayed status\n", __func__);
  		req->length = 0;
  		req->context = cdev;
+		req->complete = composite_setup_complete;
  		value = composite_ep0_queue(cdev, req, GFP_ATOMIC);
  		if (value < 0) {
  			DBG(cdev, "ep_queue --> %d\n", value);
-- 

             reply	other threads:[~2021-09-19 19:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 19:41 Florian Faber [this message]
2021-09-20  4:58 ` [PATCH] usb: gadget: composite: req->complete not set, using wrong callback for complete Greg KH
2021-09-20  5:46   ` Florian Faber
2021-09-20  6:24     ` Greg KH
2021-10-13  8:41 ` [PATCH v2] " Florian Faber
2021-10-13  8:48   ` Greg KH
2021-10-13  8:54 ` [PATCH v3] " Florian Faber
2021-10-13 12:05   ` Greg KH
2021-10-13 14:15 ` [PATCH v4] " Florian Faber
2021-11-17 14:01   ` Greg KH
2021-11-17 14:06     ` Florian Faber
2021-11-17 14:51       ` Greg KH
2021-11-27  5:20   ` Peter Chen
2021-12-01 11:04     ` Florian Faber
2021-12-01 14:12       ` 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=bded07a9-0549-569f-dcea-12e8bc7bf091@faberman.de \
    --to=faber@faberman.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.