浏览代码

usb: dwc3: ep0: make sure wValue is 0 on GetStatus()

We don't (yet) support PTM_STATUS messages so let's not reply to them
erroneously.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Felipe Balbi 8 年之前
父节点
当前提交
9b0a1f95c4
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      drivers/usb/dwc3/ep0.c

+ 6 - 0
drivers/usb/dwc3/ep0.c

@@ -319,10 +319,16 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc,
 {
 {
 	struct dwc3_ep		*dep;
 	struct dwc3_ep		*dep;
 	u32			recip;
 	u32			recip;
+	u32			value;
 	u32			reg;
 	u32			reg;
 	u16			usb_status = 0;
 	u16			usb_status = 0;
 	__le16			*response_pkt;
 	__le16			*response_pkt;
 
 
+	/* We don't support PTM_STATUS */
+	value = le16_to_cpu(ctrl->wValue);
+	if (value != 0)
+		return -EINVAL;
+
 	recip = ctrl->bRequestType & USB_RECIP_MASK;
 	recip = ctrl->bRequestType & USB_RECIP_MASK;
 	switch (recip) {
 	switch (recip) {
 	case USB_RECIP_DEVICE:
 	case USB_RECIP_DEVICE: