提交 fbdecad9 编写于 作者: A Andrzej Pietrasiewicz 提交者: Felipe Balbi

usb: gadget: f_printer: use non-zero flag for bitwise and

USB_DIR_OUT happens to be zero, so the result of bitwise and is always 0.
Consequently, break will never happen in the SOFT_RESET case.
This patch uses a compatible condition with a non-zero USB_DIR_IN,
which might or might not evaluate to zero.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 2bb2077e
......@@ -918,7 +918,7 @@ static bool gprinter_req_match(struct usb_function *f,
return false;
case SOFT_RESET:
if (!w_value && !w_length &&
(USB_DIR_OUT & ctrl->bRequestType))
!(USB_DIR_IN & ctrl->bRequestType))
break;
/* fall through */
default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册