From: Jozef Martiniak <jomajm@gmail.com>
To: jomajm@gmail.com
Cc: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Stern <stern@rowland.harvard.edu>,
Jens Axboe <axboe@kernel.dk>, Hangyu Hua <hbh25y@gmail.com>,
"Darrick J. Wong" <djwong@kernel.org>,
Wei Ming Chen <jj251510319013@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] gadgetfs: ep_io - wait until IRQ finishes
Date: Fri, 8 Jul 2022 09:06:44 +0200 [thread overview]
Message-ID: <20220708070645.6130-1-jomajm@gmail.com> (raw)
after usb_ep_queue() if wait_for_completion_interruptible() is
interrupted we need to wait until IRQ gets finished.
Otherwise complete() from epio_complete() can corrupt stack.
Signed-off-by: Jozef Martiniak <jomajm@gmail.com>
---
drivers/usb/gadget/legacy/inode.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 79990597c39f..01c3ead7d1b4 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -362,6 +362,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len)
spin_unlock_irq (&epdata->dev->lock);
DBG (epdata->dev, "endpoint gone\n");
+ wait_for_completion(&done);
epdata->status = -ENODEV;
}
}
--
2.25.1
next reply other threads:[~2022-07-08 7:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 7:06 Jozef Martiniak [this message]
2022-07-08 7:19 ` [PATCH] gadgetfs: ep_io - wait until IRQ finishes Greg Kroah-Hartman
2022-07-08 7:29 ` Jozo M.
2022-07-08 14:39 ` Alan Stern
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=20220708070645.6130-1-jomajm@gmail.com \
--to=jomajm@gmail.com \
--cc=axboe@kernel.dk \
--cc=balbi@kernel.org \
--cc=djwong@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hbh25y@gmail.com \
--cc=jj251510319013@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rdunlap@infradead.org \
--cc=stern@rowland.harvard.edu \
/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