From 362a9cd1380e16a963c20d453ae14ee3611f3f21 Mon Sep 17 00:00:00 2001 From: Mayank Rana Date: Wed, 13 Apr 2016 16:45:13 -0700 Subject: [PATCH] USB: f_fs: Use HS and SS descriptors without checking gadget speed User space function driver could always provide descriptors for all speeds irrespective of USB speed supported with USB gadget. If USB gadget is not high/super speed capable, f_fs driver doesn't parse HS or SS descriptors which results into OS descriptors processing fail due to checking against wrong offset within received descriptor buffer. Fix this issue by always processing HS and SS descriptors without checking USB gadget speed. CRs-Fixed: 1003565 Change-Id: Icb6537271ce55e44f5fc3e1ef28dd4d6810b681f Signed-off-by: Mayank Rana --- drivers/usb/gadget/function/f_fs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index cd54f6410239..48f987d77e91 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -2857,10 +2857,8 @@ static int _ffs_func_bind(struct usb_configuration *c, struct ffs_data *ffs = func->ffs; const int full = !!func->ffs->fs_descs_count; - const int high = gadget_is_dualspeed(func->gadget) && - func->ffs->hs_descs_count; - const int super = gadget_is_superspeed(func->gadget) && - func->ffs->ss_descs_count; + const int high = func->ffs->hs_descs_count; + const int super = func->ffs->ss_descs_count; int fs_len, hs_len, ss_len, ret, i;