diff options
author | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-09-22 11:25:28 +0200 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-10-31 10:15:34 +0100 |
commit | 5999914f227b20addf01297b3df24be6b4161f69 (patch) | |
tree | aec10869581a784f575a6e6c15228b90d4e3a54a /drivers/usb/dwc3/gadget.c | |
parent | usb: dwc3: gadget: set PCM1 field of isochronous-first TRBs (diff) | |
download | linux-5999914f227b20addf01297b3df24be6b4161f69.tar.xz linux-5999914f227b20addf01297b3df24be6b4161f69.zip |
usb: dwc3: gadget: properly check ep cmd
The cmd argument we pass to
dwc3_send_gadget_ep_cmd() could contain extra
arguments embedded. When checking for StartTransfer
command, we need to make sure to match only lower 4
bits which contain the actual command and ignore the
rest.
Reported-by: Janusz Dziedzic <januszx.dziedzic@intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index b3687e223e00..4ed8b34540f2 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -258,7 +258,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd, } } - if (cmd == DWC3_DEPCMD_STARTTRANSFER) { + if (DWC3_DEPCMD_CMD(cmd) == DWC3_DEPCMD_STARTTRANSFER) { int needs_wakeup; needs_wakeup = (dwc->link_state == DWC3_LINK_STATE_U1 || |