[PATCH] usb: gadget: composite: fixup bad backport

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While backporting commit eaa496ffaaf19591fe471a36cef366146eeb91538, I
made a mistake and instead of extracting bits 12:11 from wMaxPacketSize,
I extracted bits 10:0. This was reported by Bin Liu recently as can be
seen at [1].

This patch is a quick fixup patch to extract the correct bits from
wMaxPacketSize.

[1] https://marc.info/?i=20170111171305.GB18730@uda027190

Cc: <stable@xxxxxxxxxxxxxxx>
Reported-by: Bin Liu <b-liu@xxxxxx>
Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
---

Greg, let me know if this is okay. If you prefer a revert followed by
the correct patch, I can do that. No issues.

 drivers/usb/gadget/composite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index e38b21087d26..34ee6ef642cd 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -205,7 +205,7 @@ int config_ep_by_speed(struct usb_gadget *g,
 
 	if (g->speed == USB_SPEED_HIGH && (usb_endpoint_xfer_isoc(_ep->desc) ||
 				usb_endpoint_xfer_int(_ep->desc)))
-		_ep->mult = usb_endpoint_maxp(_ep->desc) & 0x7ff;
+		_ep->mult = (usb_endpoint_maxp(_ep->desc) & 0x1800) >> 11;
 
 	if (!want_comp_desc)
 		return 0;
-- 
2.11.0.295.gd7dffce1ce

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]