Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbdecad9 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 2bb2077e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -918,7 +918,7 @@ static bool gprinter_req_match(struct usb_function *f,
		return false;
		return false;
	case SOFT_RESET:
	case SOFT_RESET:
		if (!w_value && !w_length &&
		if (!w_value && !w_length &&
		   (USB_DIR_OUT & ctrl->bRequestType))
		   !(USB_DIR_IN & ctrl->bRequestType))
			break;
			break;
		/* fall through */
		/* fall through */
	default:
	default: