usb: dwc3: gadget: Fix request complete check
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Sat, 14 Dec 2019 02:40:45 +0000 (18:40 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Jan 2020 11:17:29 +0000 (12:17 +0100)
commitceaeb21b4bdaaad81577abcbf1c86d35a31071aa
tree42f8a3ea1834d0cfafdf6d2c937fa74da0e0c152
parent672d3ca2f395c8e1b92b79c03ef38953dfe79caa
usb: dwc3: gadget: Fix request complete check

commit ea0d762775e20aaff7909a3f0866ff1688b1c618 upstream.

We can only check for IN direction if the request had completed. For OUT
direction, it's perfectly fine that the host can send less than the
setup length. Let's return true fall all cases of OUT direction.

Fixes: e0c42ce590fe ("usb: dwc3: gadget: simplify IOC handling")
Cc: stable@vger.kernel.org
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Link: https://lore.kernel.org/r/ac5a3593a94fdaa3d92e6352356b5f7a01ccdc7c.1576291140.git.thinhn@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c