From: Pete Zaitcev Date: Fri, 9 Mar 2007 03:56:23 +0000 (-0800) Subject: ub: Bind to first endpoint, not to last X-Git-Tag: Ubuntu-5.2.0-15.16~45527^2~68 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=643616e6780b26dd8c9cea0b9344bb5d7aeae29d;p=mirror_ubuntu-eoan-kernel.git ub: Bind to first endpoint, not to last The usb-storage switched to binding to first endpoint recently. Apparently, there are devices out there with extra endpoints. It is perfectly legal. Signed-off-by: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 2098eff91e14..746a118a9b52 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c @@ -2132,10 +2132,13 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev, if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) { /* BULK in or out? */ - if (ep->bEndpointAddress & USB_DIR_IN) - ep_in = ep; - else - ep_out = ep; + if (ep->bEndpointAddress & USB_DIR_IN) { + if (ep_in == NULL) + ep_in = ep; + } else { + if (ep_out == NULL) + ep_out = ep; + } } }