summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJozef Martiniak <jomajm@gmail.com>2022-07-08 10:06:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-25 12:45:43 +0300
commit2b06d5d97c0e067108a122986767731d40742138 (patch)
tree6a7f3e14975a4a3e0fca5abd94f5c34efd3159b0
parent4eb7a1beff03836d3df271cd23b790884e3facb9 (diff)
downloadlinux-2b06d5d97c0e067108a122986767731d40742138.tar.xz
gadgetfs: ep_io - wait until IRQ finishes
[ Upstream commit 04cb742d4d8f30dc2e83b46ac317eec09191c68e ] 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> Link: https://lore.kernel.org/r/20220708070645.6130-1-jomajm@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/usb/gadget/legacy/inode.c1
1 files changed, 1 insertions, 0 deletions
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;
}
}