usb: gadget: f_fs: Ensure ep0req is dequeued before free_request
stable inclusion from stable-v5.10.166 commit 4b3b5cc1a7dc28992dd728a1ebb2bb9e63a3f6fb category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4b3b5cc1a7dc28992dd728a1ebb2bb9e63a3f6fb -------------------------------- [ Upstream commit ce405d56 ] As per the documentation, function usb_ep_free_request guarantees the request will not be queued or no longer be re-queued (or otherwise used). However, with the current implementation it doesn't make sure that the request in ep0 isn't reused. Fix this by dequeuing the ep0req on functionfs_unbind before freeing the request to align with the definition. Fixes: ddf8abd2 ("USB: f_fs: the FunctionFS driver") Signed-off-by: NUdipto Goswami <quic_ugoswami@quicinc.com> Tested-by: NKrishna Kurapati <quic_kriskura@quicinc.com> Link: https://lore.kernel.org/r/20221215052906.8993-3-quic_ugoswami@quicinc.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
Showing
想要评论请 注册 或 登录