提交 a5255682 编写于 作者: J Jozef Martiniak 提交者: Zheng Zengkai

gadgetfs: ep_io - wait until IRQ finishes

stable inclusion
from stable-v5.10.138
commit 9ac14f973cb91f0c01776517e6d50981f32b8038
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60QFD

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9ac14f973cb91f0c01776517e6d50981f32b8038

--------------------------------

[ Upstream commit 04cb742d ]

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: NJozef Martiniak <jomajm@gmail.com>
Link: https://lore.kernel.org/r/20220708070645.6130-1-jomajm@gmail.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 7b915752
...@@ -362,6 +362,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len) ...@@ -362,6 +362,7 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len)
spin_unlock_irq (&epdata->dev->lock); spin_unlock_irq (&epdata->dev->lock);
DBG (epdata->dev, "endpoint gone\n"); DBG (epdata->dev, "endpoint gone\n");
wait_for_completion(&done);
epdata->status = -ENODEV; epdata->status = -ENODEV;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册