Re: [PATCH v1 1/1] usb: gadget: f_fs: Add support for SuperSpeed Mode

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

 



Hi Manu,

An intern working with us here (thanks Peter!) found a bug.

On Mon, Sep 16, 2013 at 03:10:14PM +0530, Manu Gautam wrote:
> @@ -1569,7 +1573,20 @@ static int ffs_func_eps_enable(struct ffs_function *func)
>  	spin_lock_irqsave(&func->ffs->eps_lock, flags);
>  	do {
>  		struct usb_endpoint_descriptor *ds;
> -		ds = ep->descs[ep->descs[1] ? 1 : 0];
> +		int desc_idx;
> +
> +		if (ffs->gadget->speed == USB_SPEED_SUPER)
> +			desc_idx = 2;
> +		if (ffs->gadget->speed == USB_SPEED_HIGH)

This should be "else if", otherwise if the gadget is superspeed, it will
fall through to the full speed case below and desc_idx will be set to 0,
resulting in FS descriptors being used instead.

> +			desc_idx = 1;
> +		else
> +			desc_idx = 0;
> +
> +		ds = ep->descs[desc_idx];

Thanks,
Jack
-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux