提交 ae2938c3 编写于 作者: P Paul Cercueil 提交者: Greg Kroah-Hartman

usb: musb: Fix NULL check on struct musb_request field

The 'request' variable is a pointer to the 'request' field of the
struct musb_request 'req' pointer. It only worked until now because
the 'request' field is the first one in the musb_request structure, but
as soon as that changes, the check will be invalid.

Fix it preventively by doing the NULL-check on the 'req' pointer
instead.
Suggested-by: NMaarten ter Huurne <maarten@treewalker.org>
Acked-by: NTony Lindgren <tony@atomide.com>
Signed-off-by: NPaul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20210123142502.16980-2-paul@crapouillou.netSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 0eaa1a37
......@@ -451,7 +451,7 @@ void musb_g_tx(struct musb *musb, u8 epnum)
return;
}
if (request) {
if (req) {
trace_musb_req_tx(req);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册