aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2015-03-13 06:08:08 -0400
committerFelipe Balbi <balbi@ti.com>2015-03-13 11:41:05 -0400
commitfbdecad99c3f37346ed868fec0c3a9c2809f78e9 (patch)
tree343c7f3ec797185c7a734f0968e65746db18b270
parent2bb2077ee607703771c35ed74837180760f9ce07 (diff)
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/function/f_printer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
index 48882ecf1610..44173df27273 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -918,7 +918,7 @@ static bool gprinter_req_match(struct usb_function *f,
918 return false; 918 return false;
919 case SOFT_RESET: 919 case SOFT_RESET:
920 if (!w_value && !w_length && 920 if (!w_value && !w_length &&
921 (USB_DIR_OUT & ctrl->bRequestType)) 921 !(USB_DIR_IN & ctrl->bRequestType))
922 break; 922 break;
923 /* fall through */ 923 /* fall through */
924 default: 924 default: